1
0

Add GitAction

This commit is contained in:
Moikot
2020-12-17 00:58:22 +01:00
parent eeae866fef
commit 4b6208ac6a
3 changed files with 123 additions and 0 deletions

21
Dockerfile.multiarch Normal file
View File

@@ -0,0 +1,21 @@
FROM --platform=$BUILDPLATFORM golang:1.14 as build-env
# xx wraps go to automatically configure $GOOS, $GOARCH, and $GOARM
# based on TARGETPLATFORM provided by Docker.
COPY --from=tonistiigi/xx:golang-1.0.0 / /
ARG APP_FOLDER
ADD . ${APP_FOLDER}
WORKDIR ${APP_FOLDER}
# Compile independent executable using go wrapper from xx:golang
ARG TARGETPLATFORM
RUN CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o /bin/main ./cmd/nfs-subdir-external-provisioner
FROM --platform=$TARGETPLATFORM alpine:3.12
RUN apk update --no-cache && apk add ca-certificates
COPY --from=build-env /bin/main /app/main
ENTRYPOINT ["/app/main"]