Skip to content

Commit 718b4e6

Browse files
author
Gonzalo Diaz
committed
[Docker] Parametric base image version.
1 parent c5f293a commit 718b4e6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
ARG BUILDTIME_IMAGE=golang:1.24.2-alpine3.20
2+
ARG RUNTIME_IMAGE=scratch
3+
14
###############################################################################
2-
FROM golang:1.24.2-alpine3.20 AS init
5+
FROM ${BUILDTIME_IMAGE} AS init
36

47
ENV CGO_ENABLED=0
58
RUN apk add --update --no-cache make
@@ -129,8 +132,7 @@ CMD ["make", "test"]
129132
## https://shakib37.medium.com/distroless-as-the-final-container-base-image-b8af961fc826
130133
## https://chemidy.medium.com/create-the-smallest-and-secured-golang-docker-image-based-on-scratch-4752223b7324
131134

132-
FROM scratch AS production
133-
# FROM alpine:3.20.0 AS production
135+
FROM ${RUNTIME_IMAGE} AS production
134136

135137
ENV WORKDIR=/app
136138
WORKDIR ${WORKDIR}

0 commit comments

Comments
 (0)