Skip to content

Dockerfile: verify the git tags with the hashes#51626

Closed
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:git-checkout-tag-with-hash-2
Closed

Dockerfile: verify the git tags with the hashes#51626
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:git-checkout-tag-with-hash-2

Conversation

@AkihiroSuda
Copy link
Copy Markdown
Member

- What I did

Verify the tags of containerd*, runc, tini, and rootlesskit with their commit hashes for tolerance to compromise of the tags.

These binaries are depeneded by docker-ce-packaging here: https://github.com/docker/docker-ce-packaging/blob/7e726fa319c261676d06b6ae10c04a3df80e4c48/static/Makefile#L43-L58

Replaces:

Unlike the previous PR, this commit does not need the git-checkout-tag-with-hash.sh helper script.

- How I did it

By using ADD ${URL}?tag=${TAG}&checksum=${COMMIT}.

Available since Dockerfile v1.18: https://docs.docker.com/build/buildkit/dockerfile-release-notes/#1180

- How to verify it

  • make passes
  • make fails after modifying some hash

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@@ -1,10 +1,15 @@
# syntax=docker/dockerfile:1
# syntax=docker/dockerfile:1.20.0@sha256:26147acbda4f14c5add9946e2fd2ed543fc402884fd75146bd342a7f6271dc1d
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This defeats the purpose of using :1, which is on purpose a floating tag

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reconsider using a floating tag?
A floating tag can be potentially replaced to a malicious frontend

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just remove the # syntax line?

Verify the tags of containerd*, runc, tini, and rootlesskit with
their commit hashes for tolerance to compromise of the tags.

These binaries are depeneded by docker-ce-packaging here:
https://github.com/docker/docker-ce-packaging/blob/7e726fa319c261676d06b6ae10c04a3df80e4c48/static/Makefile#L43-L58

Replaces PR 49674

Unlike the previous PR, this commit does not need the
`git-checkout-tag-with-hash.sh` helper script.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda AkihiroSuda force-pushed the git-checkout-tag-with-hash-2 branch from a1c046a to 2e027a6 Compare December 1, 2025 10:40
@AkihiroSuda AkihiroSuda removed the area/rootless Rootless Mode label Dec 1, 2025
@AkihiroSuda
Copy link
Copy Markdown
Member Author

Will revisit after the release of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants