File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1+ # Dockerfile has specific requirement to put this ARG at the beginning:
2+ # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
3+ ARG BUILDER_IMAGE
4+ ARG BASE_IMAGE
5+
16# # Multistage build
2- FROM golang:1.23-alpine AS build
7+ FROM ${BUILDER_IMAGE} as builder
38ENV CGO_ENABLED=0
49ENV GOOS=linux
510ENV GOARCH=amd64
@@ -9,12 +14,11 @@ COPY . .
914WORKDIR /src/pkg/ext-proc
1015RUN go mod download
1116RUN go build -o /ext-proc
12- FROM alpine:latest
17+
1318# # Multistage deploy
14- FROM gcr.io/distroless/base-debian10
15- # Install bash
19+ FROM ${BASE_IMAGE}
1620
1721WORKDIR /
18- COPY --from=build /ext-proc /ext-proc
22+ COPY --from=builder /ext-proc /ext-proc
1923
2024ENTRYPOINT ["/ext-proc" ]
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ IMAGE_NAME := epp
3131IMAGE_REPO ?= $(IMAGE_REGISTRY ) /$(IMAGE_NAME )
3232IMAGE_TAG ?= $(IMAGE_REPO ) :$(GIT_TAG )
3333
34- # Use distroless as minimal base image to package the manager binary
35- # Refer to https://github.com/GoogleContainerTools/distroless for more details
36- BASE_IMAGE ?= gcr.io/distroless/static:nonroot
37- BUILDER_IMAGE ?= golang:$(GO_VERSION )
34+ BASE_IMAGE ?= gcr.io/distroless/base-debian10
35+ BUILDER_IMAGE ?= golang:1.23-alpine
36+ ifdef GO_VERSION
37+ BUILDER_IMAGE = golang:$(GO_VERSION )
38+ endif
3839
3940ifdef EXTRA_TAG
4041IMAGE_EXTRA_TAG ?= $(IMAGE_REPO ) :$(EXTRA_TAG )
You can’t perform that action at this time.
0 commit comments