Skip to content

Commit 2a9c198

Browse files
committed
Fix release Dockerfile's base builder image - use the same distro as in the runner image
1 parent 53a846f commit 2a9c198

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

build-tools/docker/Dockerfile.builder

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@
88
# TODO: dockerfile 1.7 syntax allows specifying --exclude for COPY, so the same can be done
99
# without an additional stage. But at the moment of writing this it's still experimental.
1010
# Switch to using it when it becomes stable.
11-
FROM rust as source
11+
12+
# Note: the base image here doesn't really matter, we just use the same one as in the "builder"
13+
# stage below.
14+
FROM rust:bookworm as source
1215
COPY . /src
1316
RUN rm -r /src/build-tools
1417

15-
FROM rust AS builder
18+
# Note: the builder image should use the same or an older distro compared to the runner images,
19+
# so that its GLIBC version is also the same or older. Otherwise the built executables have
20+
# a chance to get a dependency on a newer version of some GLIBC symbol that is not present
21+
# in the runner's GLIBC, and the executables won't work.
22+
# TODO: consider producing musl-based executables instead.
23+
FROM rust:bookworm AS builder
1624

1725
WORKDIR /usr/src/
1826

build-tools/docker/Dockerfile.runner-base

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Note: this must be consistent with the builder image's base image, see the corresponding comment
2+
# in Dockerfile.builder.
13
FROM debian:bookworm-slim
24

35
RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)