From 69866836ed45d4be2d8b7574b308b61474325c9b Mon Sep 17 00:00:00 2001 From: yongsong you Date: Thu, 17 Jun 2021 03:52:49 +0800 Subject: [PATCH] support multi arch images (#84) remove `GOARCH` env in Dockerfile to support multi arch images. Building multi arch images is easy with `docker buildx`: * enable `docker buildx` feature following the [docs](https://docs.docker.com/buildx/working-with-buildx/) * run `docker buildx create --name builder --use` to create a builder instance(only need run once) * run following command to build and push muti arch images: `docker buildx build --platform linux/amd64,linux/arm64 -t opsgenie/kubernetes-event-exporter:v0.9 --push .` --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7520cafe..76df78df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.16 AS builder ADD . /app WORKDIR /app -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO11MODULE=on go build -mod=vendor -a -o /main . +RUN CGO_ENABLED=0 GOOS=linux GO11MODULE=on go build -mod=vendor -a -o /main . FROM gcr.io/distroless/base COPY --from=builder --chown=nonroot:nonroot /main /kubernetes-event-exporter