Skip to content

Commit b31bdea

Browse files
sgeanninaNina Segares
authored and
Nina Segares
committed
Declare 'builder' image in two steps to allow overridding the value
1 parent b48e438 commit b31bdea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313
# limitations under the License.
1414
ARG BASEIMAGE
1515

16-
FROM golang:1.22.1-bookworm@sha256:6699d2852712f090399ccd4e8dfd079b4d55376f3ab3aff5b2dc8b7b1c11e27e as builder
16+
# "builder-base" can be overriden using dockerb buildx's --build-context flag,
17+
# by users who want to use a different images for the builder. E.g. if you need to use an older OS
18+
# to avoid dependencies on very recent glibc versions.
19+
# E.g. of the param: --build-context builder-base=docker-image://golang:<something>@sha256:<something>
20+
# Must override builder-base, not builder, since the latter is referred to later in the file and so must not be
21+
# directly replaced. See here, and note that "stage" parameter mentioned there has been renamed to
22+
# "build-context": https://github.com/docker/buildx/pull/904#issuecomment-1005871838
23+
FROM golang:1.22.1-bookworm@sha256:6699d2852712f090399ccd4e8dfd079b4d55376f3ab3aff5b2dc8b7b1c11e27e as builder-base
24+
FROM builder-base as builder
1725
LABEL maintainer="Andy Xie <[email protected]>"
1826

1927
ARG TARGETARCH

0 commit comments

Comments
 (0)