Skip to content

Commit 14444a5

Browse files
bartlomiejuclaude
andcommitted
Add SHA256 checksum verification for downloaded binaries
Verify integrity of the Deno binary (bin.dockerfile) and tini binary (alpine, ubuntu, debian, distroless) using upstream .sha256sum files. This is a requirement for docker-library/official-images inclusion. Closes #162 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 293a204 commit 14444a5

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

alpine.dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ARG TARGETARCH
1212

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

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

bin.dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ 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 \
14+
RUN export DENO_TARGET=$(echo $TARGETARCH | sed -e 's/arm64/aarch64/' -e 's/amd64/x86_64/') \
15+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-${DENO_TARGET}-unknown-linux-gnu.zip \
1516
--output deno.zip \
17+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-${DENO_TARGET}-unknown-linux-gnu.zip.sha256sum \
18+
--output deno.zip.sha256sum \
19+
&& sha256sum -c deno.zip.sha256sum \
1620
&& unzip deno.zip \
17-
&& rm deno.zip \
21+
&& rm deno.zip deno.zip.sha256sum \
1822
&& chmod 755 deno
1923

2024

debian.dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ARG TARGETARCH
1212

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

1721

distroless.dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ARG TARGETARCH
1212

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

1721

ubuntu.dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ARG TARGETARCH
1212

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

1721

0 commit comments

Comments
 (0)