mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-20 03:55:10 +02:00
build consistent statically linked binary for docker image
* use golang 1.10.1 images everywhere * introduce a `static-linux` target to build a statically linked 64-bit binary only * use that binary for the official image and the circle build and tests * use a multi-stage dockerfile for a consistent build environment
This commit is contained in:
+14
-1
@@ -1,3 +1,16 @@
|
||||
FROM golang:1.10.1-alpine3.7 as builder
|
||||
|
||||
RUN apk add --no-cache make git
|
||||
WORKDIR /go/src/github.com/roboll/helmfile/
|
||||
|
||||
COPY Makefile /go/src/github.com/roboll/helmfile/Makefile
|
||||
RUN make tools
|
||||
|
||||
COPY . /go/src/github.com/roboll/helmfile/
|
||||
RUN make static-linux
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
FROM alpine:3.7
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
@@ -11,6 +24,6 @@ RUN wget ${HELM_LOCATION}/${HELM_FILENAME} && \
|
||||
tar zxf ${HELM_FILENAME} && mv /linux-amd64/helm /usr/local/bin/ && \
|
||||
rm ${HELM_FILENAME} && rm -r /linux-amd64
|
||||
|
||||
COPY dist/helmfile_linux_amd64 /usr/local/bin/helmfile
|
||||
COPY --from=builder /go/src/github.com/roboll/helmfile/dist/helmfile_linux_amd64 /usr/local/bin/helmfile
|
||||
|
||||
CMD ["/usr/local/bin/helmfile"]
|
||||
|
||||
Reference in New Issue
Block a user