File tree 2 files changed +14
-9
lines changed
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
+
1
6
# # Multistage build
2
- FROM golang:1.23-alpine AS build
7
+ FROM ${BUILDER_IMAGE} as builder
3
8
ENV CGO_ENABLED=0
4
9
ENV GOOS=linux
5
10
ENV GOARCH=amd64
@@ -9,12 +14,11 @@ COPY . .
9
14
WORKDIR /src/pkg/ext-proc
10
15
RUN go mod download
11
16
RUN go build -o /ext-proc
12
- FROM alpine:latest
17
+
13
18
# # Multistage deploy
14
- FROM gcr.io/distroless/base-debian10
15
- # Install bash
19
+ FROM ${BASE_IMAGE}
16
20
17
21
WORKDIR /
18
- COPY --from=build /ext-proc /ext-proc
22
+ COPY --from=builder /ext-proc /ext-proc
19
23
20
24
ENTRYPOINT ["/ext-proc" ]
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ IMAGE_NAME := epp
31
31
IMAGE_REPO ?= $(IMAGE_REGISTRY ) /$(IMAGE_NAME )
32
32
IMAGE_TAG ?= $(IMAGE_REPO ) :$(GIT_TAG )
33
33
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
38
39
39
40
ifdef EXTRA_TAG
40
41
IMAGE_EXTRA_TAG ?= $(IMAGE_REPO ) :$(EXTRA_TAG )
You can’t perform that action at this time.
0 commit comments