From d41185eb84bd6573981e777c840faa389cba3501 Mon Sep 17 00:00:00 2001 From: Sumanth Chinthagunta Date: Mon, 25 Nov 2019 18:42:24 -0800 Subject: [PATCH] go-micro docker now includes unprivileged user --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 975cca65..4d993447 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ FROM golang:1.13-alpine + +RUN mkdir /user && \ + echo 'nobody:x:65534:65534:nobody:/:' > /user/passwd && \ + echo 'nobody:x:65534:' > /user/group + ENV GO111MODULE=on -RUN apk --no-cache add make git gcc libtool musl-dev +RUN apk --no-cache add make git gcc libtool musl-dev ca-certificates && \ + rm -rf /var/cache/apk/* /tmp/* + WORKDIR / -COPY go.mod . -COPY go.sum . +COPY ./go.mod ./go.sum ./ RUN go mod download && rm go.mod go.sum