From c741c5a1aa6b960a573613469791149c8cb91878 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Thu, 12 Sep 2019 08:32:25 +0100 Subject: [PATCH] Sync Dockerfiles for armhf/arm64 This may relate to the issue reported in #506 The armhf Dockerfile did not get the change to move to a non-root user, which was applied some time back to x86_64. Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- Dockerfile.arm64 | 21 ++++++++++++++++++--- Dockerfile.armhf | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 66dd4d13e..3116643e4 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -19,13 +19,28 @@ RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \ FROM alpine:3.10 as ship -RUN apk --no-cache add ca-certificates -WORKDIR /root/ +LABEL org.label-schema.license="MIT" \ + org.label-schema.vcs-url="https://github.com/openfaas/faas-netes" \ + org.label-schema.vcs-type="Git" \ + org.label-schema.name="openfaas/faas-netes" \ + org.label-schema.vendor="openfaas" \ + org.label-schema.docker.schema-version="1.0" + +RUN addgroup -S app \ + && adduser -S -g app app \ + && apk --no-cache add \ + ca-certificates + +WORKDIR /home/app EXPOSE 8080 + ENV http_proxy "" ENV https_proxy "" -COPY --from=build /go/src/github.com/openfaas/faas-netes/faas-netes . +COPY --from=0 /go/src/github.com/openfaas/faas-netes/faas-netes . +RUN chown -R app:app ./ + +USER app CMD ["./faas-netes"] diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 66dd4d13e..3116643e4 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -19,13 +19,28 @@ RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \ FROM alpine:3.10 as ship -RUN apk --no-cache add ca-certificates -WORKDIR /root/ +LABEL org.label-schema.license="MIT" \ + org.label-schema.vcs-url="https://github.com/openfaas/faas-netes" \ + org.label-schema.vcs-type="Git" \ + org.label-schema.name="openfaas/faas-netes" \ + org.label-schema.vendor="openfaas" \ + org.label-schema.docker.schema-version="1.0" + +RUN addgroup -S app \ + && adduser -S -g app app \ + && apk --no-cache add \ + ca-certificates + +WORKDIR /home/app EXPOSE 8080 + ENV http_proxy "" ENV https_proxy "" -COPY --from=build /go/src/github.com/openfaas/faas-netes/faas-netes . +COPY --from=0 /go/src/github.com/openfaas/faas-netes/faas-netes . +RUN chown -R app:app ./ + +USER app CMD ["./faas-netes"]