mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 00:36:46 +00:00
Add Dockerfile override for ARM64
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
parent
0ca78b1fab
commit
ced4ee56dc
34
auth/basic-auth/Dockerfile.arm64
Normal file
34
auth/basic-auth/Dockerfile.arm64
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
FROM golang:1.10-alpine3.9 as build
|
||||||
|
|
||||||
|
RUN apk add --no-cache curl ca-certificates gcc musl-dev
|
||||||
|
RUN curl -sLSf https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
|
||||||
|
&& mv ./license-check /usr/bin/
|
||||||
|
|
||||||
|
WORKDIR /go/src/handler
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Run a gofmt and exclude all vendored code.
|
||||||
|
|
||||||
|
RUN license-check -path ./ --verbose=false "OpenFaaS Authors" "OpenFaaS Author(s)" \
|
||||||
|
&& test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" \
|
||||||
|
&& go test $(go list ./... | grep -v /vendor/) -cover && \
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
|
||||||
|
|
||||||
|
FROM alpine:3.9
|
||||||
|
# Add non-root user
|
||||||
|
RUN addgroup -S app && adduser -S -g app app \
|
||||||
|
&& mkdir -p /home/app \
|
||||||
|
&& chown app /home/app
|
||||||
|
|
||||||
|
WORKDIR /home/app
|
||||||
|
|
||||||
|
COPY --from=build /go/src/handler/handler .
|
||||||
|
|
||||||
|
RUN chown -R app /home/app
|
||||||
|
|
||||||
|
USER app
|
||||||
|
|
||||||
|
WORKDIR /home/app
|
||||||
|
|
||||||
|
CMD ["./handler"]
|
||||||
|
|
@ -3,11 +3,13 @@ set -e
|
|||||||
|
|
||||||
export arch=$(uname -m)
|
export arch=$(uname -m)
|
||||||
export eTAG="latest-dev"
|
export eTAG="latest-dev"
|
||||||
|
export DOCKERFILE="Dockerfile"
|
||||||
|
|
||||||
if [ "$arch" = "armv7l" ] ; then
|
if [ "$arch" = "armv7l" ] ; then
|
||||||
eTAG="latest-armhf-dev"
|
eTAG="latest-armhf-dev"
|
||||||
elif [ "$arch" = "aarch64" ] ; then
|
elif [ "$arch" = "aarch64" ] ; then
|
||||||
eTAG="latest-arm64-dev"
|
eTAG="latest-arm64-dev"
|
||||||
|
DOCKERFILE="Dockerfile.arm64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$1"
|
echo "$1"
|
||||||
@ -24,4 +26,5 @@ NS=openfaas
|
|||||||
|
|
||||||
echo Building $NS/basic-auth-plugin:$eTAG
|
echo Building $NS/basic-auth-plugin:$eTAG
|
||||||
|
|
||||||
docker build -t $NS/basic-auth-plugin:$eTAG .
|
docker build -t $NS/basic-auth-plugin:$eTAG . -f $DOCKERFILE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user