Tighten Dockerfile: pinning, certs, GPG hygiene#6
Open
soulgalore wants to merge 4 commits into
Open
Conversation
The base image is pinned to a specific Ubuntu noble tag so that builds are reproducible from day to day. The previous apt-get upgrade -y step undid that by pulling in whatever happened to be current in the Ubuntu archive at build time, so the pin only controlled the starting point and not the result. Drop the upgrade and let rebases of the base tag be the explicit signal that we want to take in updated packages. ca-certificates was grouped with the build-time tools and removed by the final apt-get purge --auto-remove, leaving the resulting image without a system CA bundle. Anything downstream that talks HTTPS (the npm registry, sitespeed's own network probes) would either have to reinstall it or fall back to Node's bundled certs. Install ca-certificates separately so it survives the purge. GPG was run against the default home, which writes keys and an agent socket into /root/.gnupg and leaves them in the final layer. Move GnuPG to a temporary GNUPGHOME, stop the agent, and remove the directory once verification is done so no keyring material ships in the image. Finally, the original line continuation between PLATFORM= and buildDeps= was missing an &&. It happened to work because export accepts several name=value pairs, but the intent was a chained command sequence — add the && so the structure matches what's actually meant. Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The base image is pinned to a specific Ubuntu noble tag so that
builds are reproducible from day to day. The previous apt-get upgrade -y step undid that by pulling in whatever
happened to be
current in the Ubuntu archive at build time, so the pin only
controlled the starting point and not the result. Drop the upgrade
and let rebases of the base tag be the explicit signal that we want
to take in updated packages.
ca-certificates was grouped with the build-time tools and removed
by the final apt-get purge --auto-remove, leaving the resulting
image without a system CA bundle. Anything downstream that talks
HTTPS (the npm registry, sitespeed's own network probes) would
either have to reinstall it or fall back to Node's bundled certs.
Install ca-certificates separately so it survives the purge.
GPG was run against the default home, which writes keys and an
agent socket into /root/.gnupg and leaves them in the final
layer. Move GnuPG to a temporary GNUPGHOME, stop the agent, and
remove the directory once verification is done so no keyring
material ships in the image.
Finally, the original line continuation between PLATFORM= and
buildDeps= was missing an &&. It happened to work because
export accepts several name=value pairs, but the intent was a
chained command sequence — add the && so the structure matches
what's actually meant.
Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com