Skip to content

Commit 05bc542

Browse files
bartlomiejuclaude
andauthored
Add SHA256 checksum verification for downloaded binaries (#521)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 01a6547 commit 05bc542

5 files changed

Lines changed: 33 additions & 8 deletions

File tree

alpine.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ ARG TINI_VERSION=0.19.0
1111
ARG TARGETARCH
1212

1313
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH} \
14-
--output /tini \
14+
--output /tini-${TARGETARCH} \
15+
&& curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH}.sha256sum \
16+
--output /tini-${TARGETARCH}.sha256sum \
17+
&& cd / && sha256sum -c tini-${TARGETARCH}.sha256sum \
18+
&& mv /tini-${TARGETARCH} /tini \
19+
&& rm /tini-${TARGETARCH}.sha256sum \
1520
&& chmod +x /tini
1621

1722
FROM gcr.io/distroless/cc@sha256:66d87e170bc2c5e2b8cf853501141c3c55b4e502b8677595c57534df54a68cc5 as cc

bin.dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ RUN export DEBIAN_FRONTEND=noninteractive \
1111
ARG DENO_VERSION
1212
ARG TARGETARCH
1313

14-
RUN curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-$(echo $TARGETARCH | sed -e 's/arm64/aarch64/' -e 's/amd64/x86_64/')-unknown-linux-gnu.zip \
15-
--output deno.zip \
16-
&& unzip deno.zip \
17-
&& rm deno.zip \
14+
RUN export DENO_TARGET=$(echo $TARGETARCH | sed -e 's/arm64/aarch64/' -e 's/amd64/x86_64/') \
15+
&& export DENO_ZIP=deno-${DENO_TARGET}-unknown-linux-gnu.zip \
16+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/${DENO_ZIP} \
17+
--output ${DENO_ZIP} \
18+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/${DENO_ZIP}.sha256sum \
19+
--output ${DENO_ZIP}.sha256sum \
20+
&& sha256sum -c ${DENO_ZIP}.sha256sum \
21+
&& unzip ${DENO_ZIP} \
22+
&& rm ${DENO_ZIP} ${DENO_ZIP}.sha256sum \
1823
&& chmod 755 deno
1924

2025

debian.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ ARG TINI_VERSION=0.19.0
1111
ARG TARGETARCH
1212

1313
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH} \
14-
--output /tini \
14+
--output /tini-${TARGETARCH} \
15+
&& curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH}.sha256sum \
16+
--output /tini-${TARGETARCH}.sha256sum \
17+
&& cd / && sha256sum -c tini-${TARGETARCH}.sha256sum \
18+
&& mv /tini-${TARGETARCH} /tini \
19+
&& rm /tini-${TARGETARCH}.sha256sum \
1520
&& chmod +x /tini
1621

1722

distroless.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ ARG TINI_VERSION=0.19.0
1111
ARG TARGETARCH
1212

1313
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH} \
14-
--output /tini \
14+
--output /tini-${TARGETARCH} \
15+
&& curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH}.sha256sum \
16+
--output /tini-${TARGETARCH}.sha256sum \
17+
&& cd / && sha256sum -c tini-${TARGETARCH}.sha256sum \
18+
&& mv /tini-${TARGETARCH} /tini \
19+
&& rm /tini-${TARGETARCH}.sha256sum \
1520
&& chmod +x /tini
1621

1722

ubuntu.dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ ARG TINI_VERSION=0.19.0
1111
ARG TARGETARCH
1212

1313
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH} \
14-
--output /tini \
14+
--output /tini-${TARGETARCH} \
15+
&& curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TARGETARCH}.sha256sum \
16+
--output /tini-${TARGETARCH}.sha256sum \
17+
&& cd / && sha256sum -c tini-${TARGETARCH}.sha256sum \
18+
&& mv /tini-${TARGETARCH} /tini \
19+
&& rm /tini-${TARGETARCH}.sha256sum \
1520
&& chmod +x /tini
1621

1722

0 commit comments

Comments
 (0)