Skip to content

chore(image): clean up apt state, opt-out env and unused tools - #14

Merged
dan-petty merged 4 commits into
mainfrom
chore/13-image-cleanup
Nov 20, 2026
Merged

dan-petty merged 4 commits into
mainfrom
chore/13-image-cleanup

Conversation

@dan-petty

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

Copy link
Copy Markdown
Owner

Clean up the image build.

  • apt step: no cache mount, no keep-cache step, one apt-get update && apt-get upgrade && apt-get install ... && rm -rf /var/lib/apt/lists/*. apt keeps extended_states and marks the dependencies as automatic.
  • One opt-out ENV block in the last stage: telemetry, update notices, self-update. Copilot downloads no newer version by itself; one copy of its package per version stays in ~/.cache/copilot/pkg (owner decision on chore(image): clean up apt state, opt-out env and unused tools #13).
  • No mise in the image. bandit and pre-commit stay: the devops-cli devcontainer gets bandit only from devtools.
  • The python-tools stage removes the venv .lock files that all users can write.
  • test/manifests.sh (CI, before the build) fails when the copy loop and mise.toml do not name the same commands. The README points to the manifests.
  • test/tools.sh checks the apt marks, no mise, and no writable lock file.

Closes #13

- The apt step has no cache mount and no keep-cache configuration. It
  removes the package lists in its layer. apt now keeps
  /var/lib/apt/extended_states, so it marks the dependencies as
  automatic and `apt-get autoremove` works.
- One ENV block in the last stage stops the telemetry, the update
  notices and the self-update of the tools for each consumer.
- The image has no mise command and no apt bandit package. pre-commit
  stays.
- The python-tools stage removes the venv .lock files that all users
  can write.
- test/manifests.sh fails the CI when the copy loop of the Dockerfile
  and mise.toml do not name the same commands. The README points to the
  manifests and does not copy the tool lists.
- test/tools.sh checks the state of the image: the apt marks, the
  opt-out variables, no mise or bandit, and no writable lock file.
@dan-petty dan-petty added type/chore Type chore: maintenance, such as a dependency update scope/image The Dockerfile, the image layers and the tool test labels Nov 20, 2026
- The published devops-cli devcontainer image exports its venv with
  --no-dev, so the apt bandit of devtools is its only bandit. The apt
  list keeps bandit, and test/tools.sh runs it again.
- The Go toolchain does not read GOTELEMETRY from the environment, and
  the image has no Go. The ENV block does not set it.
- test/tools.sh does not repeat the values of the ENV block.
@dan-petty

Copy link
Copy Markdown
Owner Author

Proof of the opt-out ENV block. The env value check is not in test/tools.sh now (no tests that only assert config values), so this comment records the proof once.

CI run 44761593265 on 6b5453e ran a printenv check in test/tools.sh that compared each variable with its value, and stopped with FAIL on a difference. It passed on the two platforms:

  • amd64 job: DO_NOT_TRACK=1, OPENSPEC_TELEMETRY=0, OPENSPEC_NO_UPDATE_CHECK=1, GH_NO_UPDATE_NOTIFIER=1, npm_config_update_notifier=false, COPILOT_AUTO_UPDATE=false, DISABLE_AUTOUPDATER=1, SEMGREP_SEND_METRICS=off, SEMGREP_ENABLE_VERSION_CHECK=0 (and GOTELEMETRY=off), step done in 5.9 s with no FAIL.
  • arm64 job: the same variables, step done in 5.2 s with no FAIL.

d2a8dc3 removes only GOTELEMETRY=off from the block: the Go toolchain does not read it from the environment, and the image has no Go. The other nine values do not change.

Copilot downloads no newer version by itself. It still writes one copy
of its package for each version to ~/.cache/copilot/pkg (owner decision
on #13).
A devops gh call in this clone wrote them; they are not part of the change.
@dan-petty
dan-petty marked this pull request as ready for review November 20, 2026 15:49
@dan-petty
dan-petty merged commit f879db1 into main Nov 20, 2026
8 checks passed
@dan-petty
dan-petty deleted the chore/13-image-cleanup branch November 20, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/image The Dockerfile, the image layers and the tool test type/chore Type chore: maintenance, such as a dependency update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(image): clean up apt state, opt-out env and unused tools

1 participant