Skip to content

Commit

Permalink
Merge pull request #1341 from tu1h/image_build_enhance
Browse files Browse the repository at this point in the history
Image building enhancement
  • Loading branch information
ErikJiang authored Aug 19, 2024
2 parents 85cf3a2 + 86f1453 commit f50138e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions build/images/kubean-admission/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.4 as build
FROM --platform=$BUILDPLATFORM golang:1.22.4 as build

WORKDIR /kubean

Expand All @@ -7,7 +7,8 @@ ENV GO111MODULE=on \

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -o kubean-admission ./cmd/kubean-admission/main.go
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -mod vendor -o kubean-admission ./cmd/kubean-admission/main.go

FROM alpine:3.15

Expand Down
5 changes: 3 additions & 2 deletions build/images/kubean-operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.4 as build
FROM --platform=$BUILDPLATFORM golang:1.22.4 as build

WORKDIR /kubean

Expand All @@ -7,7 +7,8 @@ ENV GO111MODULE=on \

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -o kubean-operator ./cmd/kubean-operator/main.go
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -mod vendor -o kubean-operator ./cmd/kubean-operator/main.go

FROM alpine:3.15

Expand Down

0 comments on commit f50138e

Please sign in to comment.