Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable docker digest pinning #124

Merged
merged 3 commits into from
Sep 10, 2024
Merged

Enable docker digest pinning #124

merged 3 commits into from
Sep 10, 2024

Conversation

AaronMoat
Copy link
Contributor

This is important for reproducible builds.

It's a best practise per Renovate, and they have a good explanation here: https://docs.renovatebot.com/docker/#digest-pinning.

Digest Pinning
We recommend that you pin your Docker images to an exact digest. By pinning to a digest you make your Docker builds immutable, every time you do a pull you get the same content.

If you work with dependencies in the JavaScript/npm ecosystem, you may be used to exact versions being immutable. For example, if you set a version like 2.0.1, you and your colleagues always get the exact same "code".

Docker's tags are not immutable versions, even if tags look like a version. You probably expect myimage:1 and > myimage:1.2 to change over time, but you might incorrectly assume that myimage:1.2.0 never changes. Although it probably shouldn't, the reality is that any Docker image tag can change content, and potentially break.

By replacing Docker tags with Docker digests as the image's primary identifier you'll get immutable builds. Working with strings like FROM node@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e is hard. > Luckily Renovate can update the digests for you.

When pinning a digest, Renovate retains the Docker tag in the FROM line for readability, like this: FROM node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e.

@AaronMoat AaronMoat requested a review from a team as a code owner September 2, 2024 02:00
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

This makes perfect sense if we can keep the review load manageable (automerge? 🌶️)

@AaronMoat
Copy link
Contributor Author

Ah yeah we might need a new schedule. This change only turns on pinning, but more updates could get triggered as a result of the pin. I'll monitor internally to confirm before merging this :)

@AaronMoat
Copy link
Contributor Author

I've added a weekly automerge schedule; there was no need to change the non-critical as it's caught by the "all dependencies" group explicitly with matchUpdateTypes including digest.

third-party-major.json Outdated Show resolved Hide resolved
default.json Outdated Show resolved Hide resolved
@AaronMoat AaronMoat merged commit 63a1616 into master Sep 10, 2024
2 checks passed
@AaronMoat AaronMoat deleted the docker-digests branch September 10, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants