Repository navigation
Docker: sign images with cosign, publish manually after the release from the GPG-signed tarballs - #9764
Open
ShahanaFarooqui wants to merge 4 commits into
Open
Docker: sign images with cosign, publish manually after the release from the GPG-signed tarballs#9764ShahanaFarooqui wants to merge 4 commits into
ShahanaFarooqui wants to merge 4 commits into
Conversation
With --build-arg LIGHTNINGD_FROM=release the image installs the
reproducibly built Ubuntu 22.04 tarball of ${VERSION} from the GitHub
release instead of compiling, after tools/verify-release-tarball.sh
has checked it against the SHA256SUMS manifest, the manifest's
signatures and the keys in contrib/keys. The script reads gpg's
status lines, since `gpg --verify` fails whenever a co-signer's key is
unknown. The binaries are not stripped, so they stay byte-identical
to the signed tarball. The default source mode is unchanged.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Docker images leave the release action. The new "Publish Docker images 🐳" workflow is run from the checklist once the release is public: <version> and <version>-vls are built from the tagged source as before, the new <version>-signed installs the GPG-signed release tarball (LIGHTNINGD_FROM=release), requiring two good signatures by default. Running after the release is public means the manifests carry the maintainers' signatures, nothing is published before the release was checked, and any release can be re-published, since the tarballs come from the release page rather than expiring artifacts. docker-build.yml and docker-publish.yml take a `variants` input, build from the tag they label, and refuse -signed for a tag whose Dockerfile predates it. latest is pushed only when asked. Changelog-Added: Docker: `elementsproject/lightningd:v<VERSION>-signed` images install the GPG-signed reproducible release tarballs instead of compiling from source. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Keyless, under the publish workflow's GitHub OIDC identity. The signature is attached to the image on Docker Hub as an OCI referrer and recorded in Rekor; the publish job and its caller get id-token: write, no new secrets. The installation guide documents verifying the signature and, for -signed images, the contents against the GPG-signed tarball. Changelog-Added: Docker: published images are signed with cosign; the installation guide describes how to verify them. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The "Publish Docker images 🐳" workflow is the only publish path now. This target pushed unsigned, source-built images under the official name with an unconditional latest tag. --sudo and --no-push applied to nothing else, so they go with it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This branch has not been deployed
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.
Closes #9607.
Until now the Docker images were the one release artifact with no signature path: compiled by CI from source and pushed, with nothing a user could check them against. This PR changes how they are built, when they are published, and adds a signature on what is published.
A new image built from the signed release tarballs
elementsproject/lightningd:v<VERSION>-signeddoes not compile. For each platform (amd64, arm64, armv7) it installs the reproducibly built Ubuntu 22.04 tarball from the GitHub release,clightning-v<VERSION>-Ubuntu-22.04-<arch>.tar.xz.SHA256SUMSmanifest and its.asc, andtools/verify-release-tarball.shchecks the signatures against every key incontrib/keysand the tarball against its manifest line. Two good signatures are required by default; any bad signature fails the build./usr/localin the image is byte for byte the one in the tarball the maintainers signed. That is what makes the image checkable after the fact.docker build --build-arg LIGHTNINGD_FROM=release --build-arg VERSION=v<VERSION> .builds it locally. The defaultsourcemode and the existingv<VERSION>andv<VERSION>-vlsimages are unchanged.Publishing moves to a manual workflow, run after the release
workflow_dispatchworkflow, "Publish Docker images 🐳", replaces the Docker jobs inrelease.yml. The release captain runs it from the checklist once the GitHub release is public, with the version andpush-latest.v<VERSION>andv<VERSION>-vlsfrom the tagged source as before, plusv<VERSION>-signed. Release candidates get the same three.-signedfor a tag whose Dockerfile predates it.tools/build-release.sh dockeris removed. It pushed toelementsproject/lightningdfrom a laptop with personal credentials: source-built only (no-vls, no-signed), no cosign signature, andlatesttagged unconditionally, even for an rc. One run of it would break the promise that every published image verifies against the workflow identity, so it cannot stay as a fallback.--sudoand--no-pushapplied to nothing else and go with it.Why manual, after the release
Inside the release run the manifests carry only the CI key's signature, the images would go out before anyone looked at the release, and the tarballs would come from workflow artifacts that expire after 90 days. Publishing afterwards checks the maintainers' co-signatures and can re-publish any release.
Every published image is signed with cosign
-signed, a file-by-file hash comparison against the GPG-signed tarball says what is inside, with trust rooted in the maintainers' keys.Why a
-signedsuffix (for now)The tarball-based image differs from today's
lightningdin more than provenance (see below), and the signed-tarball build has never been exercised in a release. Publishing it under a new tag lets it run for a few releases without changing whatelementsproject/lightningd:v<VERSION>users get. Once it has proven out, the plan is to make it the plainlightningd(and-vls) image, keep the-signedtags for one transition release, then drop the suffix.Decisions taken
contrib/keys; a bad signature from any key fails the build.--enable-static --disable-compat). These become the image's defaults when-signedreplaceslightningd.debian:bookworm-slimwith glibc 2.36, and a binary only runs on a glibc at least as new as the one it was built against (22.04: 2.35, 24.04: 2.39, 26.04: 2.43). When 22.04 leaves the repro matrix, the base image andCLN_RELEASE_PLATFORMmove together.-vls-signed: VLS is compiled from a pinned tag with nothing signed to check.-signedimage is 285 MB uncompressed vs 206 MB, the price of not stripping.Tested
On my fork against the published v26.12rc1 (run): all three platforms verified two signatures and the tarball,
cosign verifypasses against the workflow identity, and all 250 files of the tarball are in the published image with identical hashes. The source-built variants through the new workflow are unchanged in substance but not yet run end to end.🤖 Generated with Claude Code