-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: verify downloads using sha256 in Dockerfiles
Fixes #3993
- Loading branch information
Showing
7 changed files
with
73 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
FROM moby/buildkit:v0.10.5@sha256:ca9d86324a000a0cc6d93ae9d0d5a9df750a194d0d43644c3a71fc6230ceba44 as deps | ||
FROM moby/buildkit:v0.10.5@sha256:ca9d86324a000a0cc6d93ae9d0d5a9df750a194d0d43644c3a71fc6230ceba44 as buildkit | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache wget | ||
|
||
# ECR credential helper | ||
RUN cd /tmp && \ | ||
curl -O https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \ | ||
RUN cd /usr/local/bin && \ | ||
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \ | ||
echo "af805202cb5d627dde2e6d4be1f519b195fd5a3a35ddc88d5010b4a4e5a98dd8 docker-credential-ecr-login" | sha256sum -c && \ | ||
chmod +x docker-credential-ecr-login | ||
|
||
# GCR credential helper | ||
RUN curl -fsSL "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_amd64-2.0.1.tar.gz" \ | ||
| tar xz --to-stdout ./docker-credential-gcr \ | ||
> /tmp/docker-credential-gcr && chmod +x /tmp/docker-credential-gcr | ||
|
||
FROM moby/buildkit:v0.10.5@sha256:ca9d86324a000a0cc6d93ae9d0d5a9df750a194d0d43644c3a71fc6230ceba44 as buildkit | ||
|
||
COPY --from=deps /tmp/docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login | ||
COPY --from=deps /tmp/docker-credential-gcr /usr/local/bin/docker-credential-gcr | ||
RUN wget "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_amd64-2.0.1.tar.gz" && \ | ||
echo "90837d1d9cf16809a60d5c7891d7d0b8445b1978ad43187032a0ca93bda49ed5 docker-credential-gcr_linux_amd64-2.0.1.tar.gz" | sha256sum -c && \ | ||
tar xzf docker-credential-gcr_linux_amd64-2.0.1.tar.gz --to-stdout ./docker-credential-gcr \ | ||
> /usr/local/bin/docker-credential-gcr && \ | ||
chmod +x /usr/local/bin/docker-credential-gcr && \ | ||
rm docker-credential-gcr_linux_amd64-2.0.1.tar.gz | ||
|
||
FROM moby/buildkit:v0.10.5-rootless@sha256:3a5eca9b8d5d0e6cdcd0e756d607bf7386cd1b61950daf63afadee79b43ba8bf as buildkit-rootless | ||
|
||
COPY --from=deps /tmp/docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login | ||
COPY --from=deps /tmp/docker-credential-gcr /usr/local/bin/docker-credential-gcr | ||
COPY --from=buildkit /usr/local/bin/docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login | ||
COPY --from=buildkit /usr/local/bin/docker-credential-gcr /usr/local/bin/docker-credential-gcr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM alpine:3.15.4@sha256:a777c9c66ba177ccfea23f2a216ff6721e78a662cd17019488c417135299cd89 | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache wget | ||
|
||
# Get mutagen agent | ||
RUN curl -fsSL "https://github.com/mutagen-io/mutagen/releases/download/v0.15.0/mutagen_linux_amd64_v0.15.0.tar.gz" \ | ||
| tar xz --to-stdout mutagen-agents.tar.gz \ | ||
| tar xz --to-stdout linux_amd64 \ | ||
> /usr/local/bin/mutagen-agent && \ | ||
RUN wget "https://github.com/mutagen-io/mutagen/releases/download/v0.15.0/mutagen_linux_amd64_v0.15.0.tar.gz" && \ | ||
echo "dd4a0b6fa8b36232108075d2c740d563ec945d8e872c749ad027fa1b241a8b07 mutagen_linux_amd64_v0.15.0.tar.gz" | sha256sum -c && \ | ||
tar xzf mutagen_linux_amd64_v0.15.0.tar.gz --to-stdout mutagen-agents.tar.gz \ | ||
| tar xz --to-stdout linux_amd64 > /usr/local/bin/mutagen-agent && \ | ||
rm mutagen_linux_amd64_v0.15.0.tar.gz && \ | ||
chmod +x /usr/local/bin/mutagen-agent && \ | ||
mkdir -p /.garden && \ | ||
ln -s /usr/local/bin/mutagen-agent /.garden/mutagen-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
FROM danifernandezs/skopeo:1.41.0-alpine3.10.3@sha256:3063f966f2752491ba2c3acb0e903a001c586e0fb5f404b8e8c3ac1f9e93c9f2 | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache wget | ||
RUN cd /usr/local/bin && \ | ||
curl -O https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \ | ||
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login && \ | ||
echo "af805202cb5d627dde2e6d4be1f519b195fd5a3a35ddc88d5010b4a4e5a98dd8 docker-credential-ecr-login" | sha256sum -c && \ | ||
chmod +x docker-credential-ecr-login | ||
|
||
RUN curl -fsSL "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_amd64-2.0.1.tar.gz" \ | ||
| tar xz --to-stdout ./docker-credential-gcr \ | ||
> /usr/local/bin/docker-credential-gcr && chmod +x /usr/local/bin/docker-credential-gcr | ||
RUN wget "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_amd64-2.0.1.tar.gz" && \ | ||
echo "90837d1d9cf16809a60d5c7891d7d0b8445b1978ad43187032a0ca93bda49ed5 docker-credential-gcr_linux_amd64-2.0.1.tar.gz" | sha256sum -c && \ | ||
tar xzf docker-credential-gcr_linux_amd64-2.0.1.tar.gz --to-stdout ./docker-credential-gcr \ | ||
> /usr/local/bin/docker-credential-gcr && \ | ||
chmod +x /usr/local/bin/docker-credential-gcr && \ | ||
rm docker-credential-gcr_linux_amd64-2.0.1.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters