Skip to content

feat: build and publish the devtools image from debian sid - #3

Merged
dan-petty merged 7 commits into
mainfrom
feat/1-devtools-image
Nov 19, 2026
Merged

dan-petty merged 7 commits into
mainfrom
feat/1-devtools-image

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

One image, ghcr.io/dan-petty/devtools, FROM debian:sid, for linux/amd64 and linux/arm64. It holds the tools of the devops-cli devcontainer, runner and Job images, tools.lock and devcontainer features. It has no login user.

Each tool has one source:

  • apt: the packages float with sid, only where sid is current. Podman takes the place of Docker.
  • mise.toml and mise.lock: the URL and sha256 of each asset for linux-x64 and linux-arm64, mise install --locked, real files in /usr/local/bin.
  • The mise and uv images at a pinned digest, for mise, uv and uvx.
  • The universal hashed uv locks of semgrep and pre-commit.
  • One npm lockfile, npm ci --ignore-scripts.

The versions start at the devops-cli pins. 9 tools are at their newest release: golangci-lint 2.15.0, vale 3.27.0, gh-dash 4.26.3, pluto 5.24.5, osv-scanner 2.7.1, tflint 0.66.0, cloudflared 2026.11.1, tuicr 0.29.0 and argocd 3.6.2. The image also has OpenTelemetry Weaver 0.28.0, its newest release, because dan-petty/devops-cli#6423 removes the weaver version that devops-cli copied.

The Dockerfile has no code for one platform. npm rebuild runs one install script, that of Claude Code, which allowScripts approves. The script links the native binary of the build platform. A tool with no build for a platform fails the build: mise install --locked, UV_NO_BUILD=1 and claude --version. The README names each tool with no arm64 build. On 2026-11-19 there is none.

The Image workflow has a test job for each platform, on a GitHub-hosted runner of that architecture (ubuntu-24.04, ubuntu-24.04-arm), with no emulation. Its token cannot write packages. It builds the image with the docker driver, so Docker gets the image with no tarball. test/tools.Dockerfile runs each tool once with no network, and each command has a timeout of 60 s. The job copies gh into python:3.14-slim-trixie and runs osv-scanner on the lock files.

osv-scanner is the gate: a finding in the npm or Python locks fails the job. The Trivy scan of the image is report-only (owner decision of 2026-11-19 in #1). It writes SARIF in the category of the platform, and the job summary names the OS and the finding counts. The Trivy databases come from a daily cache that only main saves.

On main, a push job for each platform builds the image again with the docker-container driver, and pushes it by digest with SBOM and provenance. Then a verify job for each platform runs the tool test, the copy probe and the report-only Trivy scan on the pushed digest (SARIF category trivy-pushed-<arch>). The publish job makes one manifest list with docker buildx imagetools create and the date tag, attests its build provenance, and then moves latest to it. Only the push and publish jobs can write packages. A daily run rebuilds the two platforms with --pull --no-cache. Renovate uses built-in managers only.

Closes #1

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@dan-petty

dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner Author

All checks pass on head aa9d707. The PR stays a draft for the owner review. The push, verify and publish jobs run only on main, so their times come from the first run after the merge.

Review findings, round 2 (head aa9d707)

CI run 44553543853. The branch is on the current main (#5).

Finding Change Proof
1. Steps with no timeout The 6 steps get a timeout: checkout 5 min, setup-buildx 5 min, metadata 2 min. Each step of the new verify job has a timeout too. A parse of image.yml finds no step with no timeout, and no step timeout equal to or longer than its job.
2. containers-storage, command -v A loop checks containers-storage, dbus-launch, nc, newgidmap and newuidmap, and names a missing command. containers-storage version cannot run in the build (unshare(CLONE_NEWUSER): Operation not permitted), so the test checks only that the command is present. CI: /usr/bin/containers-storage on the two platforms.
3. latest before the attestation The publish job makes the manifest list with the date tag only, attests its digest, and then moves latest to it. The step stops if latest gets a different digest. In a local registry, imagetools create --tag latest of a manifest list with one source kept its digest (sha256:b92c0cc… before and after).
4. Checks on a second build On main, a verify job for each platform pulls the pushed digest and runs the tool test, the copy probe and the report-only Trivy scan on it. The SARIF goes to the category trivy-pushed-<arch>. The publish job needs the verify job. test/trivy.sh holds the scan of the test job and the verify job. The push job only builds and pushes. Locally, test/trivy.sh on a digest reference (devtools@sha256:4d952f5e…) in the image store of Docker: pass, 109 s. The SARIF locations are paths in the image (usr/local/bin/gh), so a new daily digest does not move the alerts.
5. Renovate pins ghcr.io/dan-petty/devtools:latest DEVTOOLS has the default scratch in the two test Dockerfiles. With no default, the build check InvalidDefaultArgInFrom stops the build under check=error=true, also when --build-arg gives a value. Renovate puts the ARG default into FROM and skips scratch (lib/modules/manager/dockerfile/extract.ts). With no DEVTOOLS, the tool test fails (exec: "/bin/sh": stat /bin/sh: no such file or directory) and the copy probe fails (lstat /usr/local/bin/gh: no such file or directory).
6. mise is not in the image The last stage copies /usr/local/bin/mise from the pinned mise image. The tool test runs mise --version. The bind mount stays in the mise-tools stage, because it keeps the 163 MB binary out of a layer of that stage. CI: 2026.11.10 linux-x64 and 2026.11.10 linux-arm64. With no network, mise --version waits 5 s for its update check, in the limit of 60 s.
7. README sentence on mise and uv The README says that mise, uv and uvx come from their images at a pinned digest, and the tool table has the row "mise and uv images". The CI section names the verify job and the new publish order.
Step linux/amd64 linux/arm64
Job time 3 min 29 s 3 min 50 s
Build 106 s 130 s
test/tools.Dockerfile, 65 commands and 5 presence checks, no network pass, 9 s pass, 11 s
Copy probe of gh into python:3.14-slim-trixie pass, 2 s pass, 5 s
osv-scanner on the 3 lock files (the gate) pass, 2 s pass, 1 s
Trivy, report-only, with no cache (main has no run) 70 s 65 s
SARIF upload 8 s 10 s
Image size, the sum of the uncompressed layers 4.8 GB (mise adds 0.16 GB) 4.7 GB

Trivy gives the same counts as on bf87b87: 645 Go binary findings, 306 HIGH or CRITICAL with a fix, and 6 MEDIUM Python findings. The run has no annotation.

Local command Result
actionlint, zizmor 1.32.0 --offline (default and pedantic) no finding
shellcheck test/tools.sh test/trivy.sh no finding
hadolint 2.15.1 (from the image) and docker buildx build --check of the 3 Dockerfiles no finding
amd64 build with the docker driver, tool test, copy probe pass (build 232 s, tool test 21 s)

To check after the merge: the time of the push job and the verify job, and the code scanning result of the next pull request. trivy-pushed-<arch> has no upload on a pull request, so code scanning can show a warning about a configuration of main that the pull request does not have.

Weaver (head bf87b87)

dan-petty/devops-cli#6423 removes a copied weaver version from devops-cli, so this image now has weaver, the CLI of the OpenTelemetry semantic conventions. The mise registry and the aqua registry have no entry for open-telemetry/weaver, so mise.toml uses the github backend: "github:open-telemetry/weaver" = "0.28.0", the newest release (2026-10-14). CI run 44542386532.

Check linux/amd64 linux/arm64
Archive in mise.lock weaver-x86_64-unknown-linux-gnu.tar.xz weaver-aarch64-unknown-linux-gnu.tar.xz
sha256 in mise.lock, equal to sha256.sum of the release 9878e2d56ad8… dab3251667c6…
Provenance that mise lock verified github-attestations github-attestations
mise install --locked in CI 3.0 s 1.5 s
weaver --version in the tool test, with no network weaver 0.28.0 weaver 0.28.0
Job time 3 min 51 s 3 min 24 s

The tool test now runs 64 commands. No other entry of mise.lock changed. The run has no annotation. On amd64, a local build, the tool test and the copy probe pass, and docker buildx build --check of the 3 Dockerfiles, hadolint, actionlint and shellcheck test/tools.sh give no finding.

Proof

Head f37c5ce, CI run 44538273914. Each platform builds natively on its GitHub-hosted runner (ubuntu-24.04, ubuntu-24.04-arm), with no QEMU. The values in brackets are from run 44530907100 on 875085a.

Step linux/amd64 linux/arm64
Job time 4 min 47 s (7 min 35 s) 3 min 30 s (5 min 11 s)
Build 151 s (284 s) 122 s (197 s)
Export of the image to Docker, in the build 10.5 s (144 s) 9.0 s
test/tools.Dockerfile, 63 commands with no network pass, 6 s pass, 5 s
Copy probe of gh into python:3.14-slim-trixie pass, 4 s pass, 5 s
osv-scanner on the 3 lock files (the gate) No issues found, 6 filtered, 1 s No issues found, 6 filtered, 1 s
Trivy, report-only, with no cache 110 s 59 s
SARIF upload (trivy-image-amd64, trivy-image-arm64) pass, 8 s pass, 9 s
Image size, the sum of the uncompressed layers 4.6 GB 4.5 GB

The run has no warning annotation. The metadata-action warnings and the osv-scanner ignoreUntil warning are gone.

Trivy on the two platforms: Detected OS: debian forky/sid, OS package findings 0. Go binaries: 645 findings (CRITICAL 4, HIGH 304, MEDIUM 296, LOW 19, UNKNOWN 22), 306 HIGH or CRITICAL with a fix. Python packages: 6 MEDIUM. The SARIF holds each finding.

The Trivy cache: a pull request restores the cache that main saved. Main has no run yet, so this run shows Cache not found and downloads the databases. On 875085a, the download took about 10 s for the vulnerability database and 49 s for the Java database. A local run of the step as the runner user wrote db (1.7 GB) and java-db (1.5 GB) with read access for the cache step.

Review findings

Finding Change
Trivy gate The owner decision of 2026-11-19 in #1 makes the image scan report-only. The gate stays on osv-scanner for the npm and Python locks. The workflow comments and the README say this.
Job time over 5 min + 1 min The test job builds with the docker driver, so Docker gets the image with no tarball. The Trivy databases come from a daily cache that only main saves. amd64 is at 4 min 47 s.
ignoreUntil The 6 ignores use effectiveUntil. osv-scanner 2.7.1 applies the 6 ignores and writes no warning.
packages: write on pull requests The test job has contents: read and security-events: write. On main, a push job of its own has packages: write. It builds again, pushes by digest and runs the tool test on the pushed digest.
No timeout for each tool test/tools.sh runs each command through timeout 60s. A failure names the tool and its exit status.
Metadata warnings The test job has no metadata step. The push and publish jobs keep the tags.

argocd goes to 3.6.2 (released on 2026-11-18). The new lock checksums of the two platforms agree with cli_checksums.txt of the release. Each other mise tool is at its newest release on 2026-11-19.

Other checks:

Command Result
actionlint, zizmor --offline (default, pedantic and auditor personas) no finding
shellcheck test/tools.sh no finding
docker buildx build --check of the 3 Dockerfiles no warning
Local build with the docker driver, test/tools.Dockerfile, Trivy step as the runner user pass

Gates

  • The owner reviews and merges the PR.
  • The first push to main makes the GHCR package. A person must then make it public.
  • The first run on main gives the times of the push, verify and publish jobs.

One image, ghcr.io/dan-petty/devtools, FROM debian:sid, with the tools
of the devops-cli devcontainer, its runner and Job images, its
tools.lock and its devcontainer features. Each tool has one source:

- apt, floating with sid, for each tool that sid has at a current
  version. Podman takes the place of Docker.
- mise.toml and mise.lock (sha256 of each linux-x64 asset) for the
  other binary tools. `mise install --locked` installs them, and the
  build copies each command as a real file to /usr/local/bin.
- the uv image for uv, and hashed uv locks in python/ for semgrep
  and pre-commit, each in its own virtual environment.
- npm/package.json and its lockfile for the Node tools, installed
  with `npm ci --ignore-scripts`.

The versions start at the pins of devops-cli, so that the first image
holds the same tools. The image has no login user and is for
linux/amd64 only.

The Image workflow builds the image, runs each tool once with no
network, copies gh into python:3.14-slim-trixie, scans the lock files
with osv-scanner and the image with Trivy (SARIF, a summary with the
detected OS and the finding counts, and a HIGH/CRITICAL gate). On main
it pushes the image by digest with SBOM and provenance, attests the
build provenance and tags the digest. A daily run rebuilds with --pull
--no-cache. Renovate updates every version with built-in managers only.

python/osv-scanner.toml ignores 6 semgrep advisories that no semgrep
release fixes, until 2026-11-22 (#2).
With no network, semgrep --version waits 98 s for the timeout of its version check, and SEMGREP_ENABLE_VERSION_CHECK=0 does not stop it. The --disable-version-check flag does. The tool test now takes 5 s.
Each platform builds natively on a GitHub-hosted runner of its own
architecture: ubuntu-24.04 and ubuntu-24.04-arm, with no emulation. Each
platform job builds the image, runs test/tools.sh with no network, the copy
probe, osv-scanner and Trivy. Each Trivy SARIF has the category of its
platform. On main, each platform job pushes its image by digest with SBOM and
provenance. Then the publish job makes one manifest list with
docker buildx imagetools create, tags it and attests its build provenance.

mise.lock holds the URL and checksum of each tool for linux-x64 and
linux-arm64. The Dockerfile has no code for one platform: npm rebuild runs
the install script of Claude Code, which allowScripts approves, and the
script links the native binary of the build platform. A tool with no build
for the platform fails the build: mise install --locked, UV_NO_BUILD for the
Python wheels, and claude --version for the Claude Code binary.

Update 8 tools to their newest release: golangci-lint 2.15.0, vale 3.27.0,
gh-dash 4.26.3, pluto 5.24.5, osv-scanner 2.7.1, tflint 0.66.0,
cloudflared 2026.11.1 and tuicr 0.29.0.
A paragraph of the README had 8 sentences. ASD-STE100 permits at most 6.
The owner decision of 2026-11-19 in #1 makes the Trivy scan of the image
report-only. The Go binaries of upstream tools at their newest release
hold HIGH and CRITICAL findings that no change here can fix. The gate
stays on the lock files: osv-scanner fails the job on a finding in the
npm and Python locks.

The test job builds with the docker driver of the default builder. The
image goes into the image store of Docker with no export, so the job
does not compress and send a tarball of the 4.6 GB image. The test job
restores the Trivy databases from a daily cache, and only main saves it.

The test job cannot write packages. On main, a push job of its own
builds each platform again, pushes it by digest with SBOM and
provenance, and runs the tool test on the pushed digest.

test/tools.Dockerfile runs test/tools.sh with no network. Each command
of test/tools.sh has a timeout of 60 s, shorter than the step timeout.

osv-scanner.toml uses effectiveUntil in place of the deprecated
ignoreUntil. The test job has no metadata step, so it writes no warning
about tags. argocd goes to 3.6.2, its newest release.
devops-cli needs weaver, the CLI of the OpenTelemetry semantic
conventions, in this image (devops-cli #6423). The mise registry and
the aqua registry have no entry for open-telemetry/weaver, so mise.toml
uses the github backend, as for the other tools with no short name.

mise lock wrote the URL and the sha256 of the gnu archive of each
platform. The checksums agree with sha256.sum of the v0.28.0 release,
and mise verified the GitHub artifact attestation of each archive
(provenance = "github-attestations"). No other lock entry changed.

The copy loop of the Dockerfile copies weaver to /usr/local/bin, and
test/tools.sh runs weaver --version through its timeout wrapper.
- Each step of the Image workflow has a timeout that is shorter than its job.
- test/tools.sh checks containers-storage, and names each missing command.
- On main, a verify job runs the tool test, the copy probe and the report-only
  Trivy scan on the pushed digest of each platform. The SARIF goes to the
  category trivy-pushed-<arch>. test/trivy.sh holds the scan of the two jobs.
- The publish job tags the manifest list with the date, attests it, and then
  moves latest to it. The step stops if latest gets a different digest.
- DEVTOOLS has the default scratch in the test Dockerfiles. Renovate skips
  scratch, and the build fails when DEVTOOLS is not set.
- The image has mise, from the pinned mise image. The tool test runs
  mise --version.
@dan-petty
dan-petty force-pushed the feat/1-devtools-image branch from bf87b87 to aa9d707 Compare November 19, 2026 15:19
@dan-petty
dan-petty marked this pull request as ready for review November 19, 2026 15:38
@dan-petty
dan-petty merged commit 5f04251 into main Nov 19, 2026
6 checks passed
@dan-petty
dan-petty deleted the feat/1-devtools-image branch November 19, 2026 15:39
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.

feat: build and publish the devtools image from debian sid

2 participants