Skip to content

Commit 3e83636

Browse files
williamdesDeepSeek
andcommitted
Fix Dockerfile style and specifics
Co-authored-by: DeepSeek <noreply@deepseek.com>
1 parent 23d6ca0 commit 3e83636

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎docker/Dockerfile‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.24 as builder
1+
FROM alpine:3.24 AS builder
22

33
WORKDIR /workdir
44

@@ -28,10 +28,19 @@ RUN cargo build --features freeze-stdlib --release --locked --offline --bin rust
2828

2929
FROM alpine:3.24
3030

31+
# Re-declare the build arguments in this stage: an ARG declared before the first
32+
# FROM is not visible in later stages, so without this the metadata labels below
33+
# expand to an empty string and the SBOM keeps a literal ${RUST_PYTHON_VERSION}.
34+
ARG RUST_PYTHON_VERSION
35+
ARG BUILD_DATE
36+
ARG VCS_REF
37+
3138
RUN apk --no-cache add musl libgcc
3239

3340
COPY --from=builder /workdir/target/release/rustpython /usr/local/bin/rustpython
34-
COPY <<-"EOT" /usr/local/share/sbom/rustpython.spdx.json
41+
# The heredoc marker is deliberately unquoted so that it interpolates: a quoted
42+
# marker ("EOT") would leave ${RUST_PYTHON_VERSION} in the SBOM verbatim.
43+
COPY <<-EOT /usr/local/share/sbom/rustpython.spdx.json
3544
{
3645
"spdxVersion": "SPDX-2.3",
3746
"dataLicense": "CC0-1.0",

0 commit comments

Comments
 (0)