Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
support multi arch images (#84)
Browse files Browse the repository at this point in the history
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 .`
  • Loading branch information
youyongsong authored Jun 16, 2021
1 parent 30e4027 commit 6986683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6986683

Please sign in to comment.