mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 09:12:13 +02:00
Build correct arch for container image (#817)
Signed-off-by: Lavi Blumberg <lavifb@gmail.com>
This commit is contained in:
+6
-4
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.20-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
|
||||
|
||||
RUN apk add --no-cache make git
|
||||
WORKDIR /workspace/helmfile
|
||||
@@ -7,11 +7,12 @@ COPY go.mod go.sum /workspace/helmfile/
|
||||
RUN go mod download
|
||||
|
||||
COPY . /workspace/helmfile
|
||||
RUN make static-linux
|
||||
ARG TARGETARCH
|
||||
RUN make static-linux-${TARGETARCH}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
FROM ubuntu:20.04
|
||||
FROM --platform=$BUILDPLATFORM ubuntu:20.04
|
||||
|
||||
LABEL org.opencontainers.image.source https://github.com/helmfile/helmfile
|
||||
|
||||
@@ -94,6 +95,7 @@ RUN helm plugin install https://github.com/databus23/helm-diff --version v3.6.0
|
||||
# Allow users other than root to use helm plugins located in root home
|
||||
RUN chmod 751 ${HOME}
|
||||
|
||||
COPY --from=builder /workspace/helmfile/dist/helmfile_linux_amd64 /usr/local/bin/helmfile
|
||||
ARG TARGETARCH
|
||||
COPY --from=builder /workspace/helmfile/dist/helmfile_linux_${TARGETARCH} /usr/local/bin/helmfile
|
||||
|
||||
CMD ["/usr/local/bin/helmfile"]
|
||||
|
||||
Reference in New Issue
Block a user