Skip to content

feat(release): ship the decdn CLI as a container image - #2398

Merged
thiras merged 2 commits into
mainfrom
feat/cli-container-image
Oct 9, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/cli-container-image

Conversation

@thiras

@thiras thiras commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

Ships the decdn CLI as a container image, and adds it to the node image.

  • New image ghcr.io/decdn/decdn / docker.io/decdn/decdn: CLI only, ENTRYPOINT ["decdn"], CMD ["--help"], volume at /home/decdn/.decdn.
  • decdn-node image now also contains /usr/local/bin/decdn, so docker exec <container> decdn node status reaches the loopback admin port.

Both are stages of one Dockerfile (base → decdn → decdn-node, node last so docker build . is unchanged) and copy binaries from the signed Linux release archives, as before.

Release plumbing:

  • release.yml docker job → two-leg matrix; per-image gha cache scope, SBOM <stage>-<version>-sbom.spdx.json, digest <stage>-image-digest.txt.
  • sign-release.sh signs SHA256SUMS + both digests + both SBOMs, promotes GHCR then Docker Hub, refuses a DECDN_DOCKERHUB_REPO ending in -node (its meaning is now the base repo), lists every already-promoted repo on failure, and refuses to publish while any promoted repo is not anonymously pullable.
  • check-image-name.sh checks each matrix target:/image: pair and the IMAGES list; CI docker-build checks both entrypoints and default CMDs; Trivy scans both images and fails on errors other than not-found.

Reviewer notes

  • Breaking release-asset names: image-digest.txt → decdn-node-image-digest.txt + decdn-image-digest.txt; node SBOM → decdn-node-<v>-sbom.spdx.json; decdn-<v>-sbom.spdx.json now describes the CLI image. In CHANGELOG.
  • Before the next release (maintainer, outside the repo): create Docker Hub repo decdn/decdn; after the first run, make the new GHCR package public. Note the existing ghcr.io/decdn/decdn-node package is currently private — anonymous pulls of v0.0.1 fail; the new pre-publish check would catch this.
  • The release workflow itself only runs on a tag push; the next release (or a DECDN_REPO=<fork> rehearsal) is its first end-to-end run.
  • Not changed: CHANGELOG [Unreleased] still says "no versioned tag yet" although v0.0.1 shipped.

Verification

  • Built both images from the real v0.0.1 Linux binaries: --version for both images and for decdn inside the node image; key-gen / whoami through the volume, including --user <other uid> -e HOME=/home/decdn; in-image sha256sum matches the archives (the SECURITY.md check).

  • sign-release.sh digest validation and promotion run against a stub docker: stable, prerelease, fork, wrong digest file, leftover -node Hub repo, Docker Hub failure mid-mirror, private package, both skip flags.

  • check-image-name.sh fails on swapped image: lines, a stage dropped from IMAGES, a renamed target.

  • CI docker-build steps run locally; removing CMD ["run"] makes the check fail.

  • Trivy existence check run against an existing image, a missing tag, and an anonymous lookup.

  • docker buildx build --check for both targets; shellcheck; actionlint (only ci.yml's three findings already on main); uvx --with pyyaml pytest .github/scripts/tests (170 passed); pre-commit run on changed files.

  • cargo fmt -- --check — n/a, no Rust changes

  • CARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-features — n/a

  • cargo nextest run — n/a

  • contracts/ changed — n/a

  • User-visible change: CHANGELOG.md entry added

  • Design change: ADR in adr/ added or updated (appendix-binaries.md § Distribution)

  • PR title uses an allowed type with a lowercase subject

🤖 Generated with Claude Code

Releases publish a second image, ghcr.io/decdn/decdn (mirrored to
docker.io/decdn/decdn), with `decdn` as entrypoint. The decdn-node image
also carries the CLI, so `docker exec <container> decdn node status`
reaches the daemon's loopback admin port.

- Dockerfile: base -> decdn -> decdn-node stages; node stays the default
  target and both copy binaries from the signed Linux release archives.
- release.yml: the docker job is a two-leg matrix with per-image cache
  scope, SBOM (<stage>-<version>-sbom.spdx.json) and digest file
  (<stage>-image-digest.txt); it fails on empty binaries or digest.
- sign-release.sh: signs and promotes both images (GHCR first, then
  Docker Hub), refuses a DECDN_DOCKERHUB_REPO ending in -node, reports
  every repository already promoted on failure, and refuses to publish
  while a promoted repository is not anonymously pullable.
- check-image-name.sh checks target/image pairs and the IMAGES list;
  CI's docker-build checks both entrypoints and default CMDs; the Trivy
  scan covers both images and fails on errors other than not-found.
- Docs: README, SECURITY, RELEASING (new public-package setup step),
  KEYS, ADR binaries appendix, crate READMEs, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 13:52
@thiras thiras self-assigned this Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The supply-chain workflow has broad release impact and cannot run end-to-end until a tag is pushed.

0 open findings

What changed in this PR

Adds a standalone decdn CLI container while bundling the CLI into the node image.

Changes:

  • Adds two-stage container builds and CI validation.
  • Extends release signing, promotion, SBOM, and scanning workflows.
  • Updates distribution and verification documentation.
File Description
Dockerfile Defines CLI and node image stages.
.github/​workflows/​release.yml Builds and publishes both images.
.github/​workflows/​ci.yml Validates both image contracts.
.github/​workflows/​security.yml Scans both published images.
.github/​scripts/​sign-release.sh Signs and promotes both images.
.github/​scripts/​check-image-name.sh Checks image-name consistency.
SECURITY.md Documents verification for both images.
RELEASING.md Updates the release procedure.
README.md Documents container installation and usage.
KEYS Updates signed-artifact wording.
CHANGELOG.md Records the breaking release changes.
adr/​appendix-binaries.md Updates the distribution architecture.
crates/​node/​README.md Documents the bundled CLI.
crates/​cli/​README.md Documents the CLI image.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

github-code-quality Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit c23d8c9 in the feat/cli-container-i... branch remains at 75%, unchanged from commit d70f911 in the main branch.

Show a line coverage summary of the most impacted files.
File main d70f911 feat/cli-container-i... c23d8c9 +/-
crates/client/src/sink.rs 95% 93% -2%
crates/client/src/streamer.rs 84% 83% -1%
crates/client/src/lib.rs 88% 88% 0%
crates/protocol/src/framing.rs 93% 93% 0%

Solidity / code-coverage/forge

The overall line coverage in commit c23d8c9 in the feat/cli-container-i... branch remains at 92%, unchanged from commit d70f911 in the main branch.


Updated October 09, 2026 14:06 UTC

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@thiras
thiras merged commit 16e6b31 into main Oct 9, 2026
32 checks passed
@thiras
thiras deleted the feat/cli-container-image branch October 9, 2026 14:10
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.

2 participants