mirror of
https://github.com/resmoio/kubernetes-event-exporter.git
synced 2026-08-19 14:56:27 +00:00
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 .`
13 lines
294 B
Docker
13 lines
294 B
Docker
FROM golang:1.16 AS builder
|
|
|
|
ADD . /app
|
|
WORKDIR /app
|
|
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
|
|
|
|
USER nonroot
|
|
|
|
ENTRYPOINT ["/kubernetes-event-exporter"]
|