File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
- FROM golang:1.18.3 as builder
1
+ FROM --platform=${BUILDPLATFORM} golang:1.18.3 as builder
2
+ ARG TARGETARCH
3
+ ARG TARGETOS
2
4
WORKDIR /go/src/github.com/max-rocket-internet/k8s-event-logger
3
5
COPY . .
4
6
RUN go get
5
- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o k8s-event-logger
7
+ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o k8s-event-logger
6
8
RUN adduser --disabled-login --no-create-home --disabled-password --system --uid 101 non-root
7
9
8
- FROM alpine:3.15.4
10
+ FROM --platform=${TARGETPLATFORM} alpine:3.15.4
9
11
RUN addgroup -S non-root && adduser -S -G non-root non-root
10
12
USER 101
11
13
ENV USER non-root
Original file line number Diff line number Diff line change
1
+ VERSION ?= 1.6.1
2
+ IMG ?= maxrocketinternet/k8s-event-logger:$(VERSION )
3
+
4
+ .PHONY : image
5
+
6
+ image :
7
+ docker buildx build --platform linux/amd64,linux/arm64 --push -t $(IMG ) .
You can’t perform that action at this time.
0 commit comments