Skip to content
Snippets Groups Projects
Commit 0f5ca96b authored by Richard Gee's avatar Richard Gee Committed by Alex Ellis
Browse files

Add build-args to Dockerfile.armhf


When the /system/info endpoint was expanded to include information about the gateway a number of build-args were added to the main Dockerfile.  These changes were not mirrored in Dockerfile.armhf, which resulted in nil attributes and an ugly error when running `faas version` against an armhf gateway.

This change carries the changes made to Dockerfile through to Dockerfile.armhf.  As well as the build-args which fix the identified issue the license check has also been added at the latest release 0.2.3, as a armhf build has been made available.  Further changes are to introduce the app user and moving the binary location from /root/ to /home/app/

Signed-off-by: default avatarRichard Gee <richard@technologee.co.uk>
parent d17a42ce
No related branches found
No related tags found
No related merge requests found
FROM golang:1.10.4 as build
ARG GIT_COMMIT_SHA
ARG GIT_COMMIT_MESSAGE
ARG VERSION='dev'
RUN curl -sSfL https://github.com/alexellis/license-check/releases/download/0.2.3/license-check-armhf \
> /usr/bin/license-check \
&& chmod +x /usr/bin/license-check
WORKDIR /go/src/github.com/openfaas/faas/gateway
......@@ -16,17 +23,39 @@ COPY version version
COPY scaling scaling
COPY server.go .
RUN GOARM=7 CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gateway .
# Run a gofmt and exclude all vendored code.
RUN license-check -path ./ --verbose=false "Alex Ellis" "OpenFaaS Project" "OpenFaaS Authors" "OpenFaaS Author(s)" \
&& test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" \
&& go test $(go list ./... | grep -v integration | grep -v /vendor/ | grep -v /template/) -cover \
&& GOARM=7 CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w \
-X github.com/openfaas/faas/gateway/version.GitCommitSHA=${GIT_COMMIT_SHA}\
-X \"github.com/openfaas/faas/gateway/version.GitCommitMessage=${GIT_COMMIT_MESSAGE}\"\
-X github.com/openfaas/faas/gateway/version.Version=${VERSION}" \
-a -installsuffix cgo -o gateway .
FROM alpine:3.8
WORKDIR /root/
LABEL org.label-schema.license="MIT" \
org.label-schema.vcs-url="https://github.com/openfaas/faas" \
org.label-schema.vcs-type="Git" \
org.label-schema.name="openfaas/faas" \
org.label-schema.vendor="openfaas" \
org.label-schema.docker.schema-version="1.0"
RUN addgroup -S app \
&& adduser -S -g app app
WORKDIR /home/app
EXPOSE 8080
ENV http_proxy ""
ENV https_proxy ""
COPY --from=0 /go/src/github.com/openfaas/faas/gateway/gateway .
COPY --from=build /go/src/github.com/openfaas/faas/gateway/gateway .
COPY assets assets
RUN sed -ie s/store.json/store-armhf.json/g /root/assets/script/funcstore.js
RUN sed -ie s/store.json/store-armhf.json/g /home/app/assets/script/funcstore.js
RUN chown -R app:app ./
USER app
CMD ["./gateway"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment