Move to non-root user
@@ -16,8 +16,12 @@ RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-netes .
FROM alpine:3.6
-RUN apk --no-cache add ca-certificates
-WORKDIR /root/
+
+RUN addgroup -S app \
+ && adduser -S -g app app \
+ && apk --no-cache add \
+ ca-certificates
+WORKDIR /home/app
EXPOSE 8080
@@ -25,5 +29,8 @@ ENV http_proxy ""
ENV https_proxy ""
COPY --from=0 /go/src/github.com/openfaas/faas-netes/faas-netes .
+RUN chown -R app:app ./
+
+USER app
CMD ["./faas-netes"]
