fix(image): drop the Go toolchains from the ci image's hook cache #4

Merged
Defame1297 merged 1 commits from fix/ci-image-layer-size into main 2026-10-25 11:13:49 +00:00
Owner

Problem

The first image.yml run that built mortis/ci (run 2246, job 2269) built the whole image, then failed pushing it: 413 Payload Too Large from Cloudflare on every retry. The build printed the sizes:

Path Uncompressed
/opt/pre-commit 377 MB
repo91aq4otb, repoyc4c93bl (gitleaks, actionlint) 176 MB, 172 MB
/opt/python 121 MB
/opt/venv 98 MB

pre-commit downloads a Go toolchain into <env>/.go for each Go hook and keeps it; at run time only the built binaries in <env>/bin run.

Change (images/ci/Dockerfile only)

  • Run the yamllint, gitleaks and actionlint hooks on a staged sample, delete repo*/golangenv-*/.go and the Go build cache, then run the three hooks again. An incomplete or broken cache fails the image build, not the jobs. Expected /opt/pre-commit size: roughly 40 MB.
  • The python3.X symlink loop ran under sh -c without -e, so only the last iteration decided the status; the RUN now starts with set -eu.

Verification

image.yml only runs on main, so the next push builds it. If a layer is still over the limit, the 413 log will show it; the venv (98 MB) and interpreters (121 MB) should compress to well under 100 MB each. Nothing consumes the image yet.

🤖 Generated with Claude Code

## Problem The first `image.yml` run that built `mortis/ci` (run 2246, job 2269) built the whole image, then failed pushing it: `413 Payload Too Large` from Cloudflare on every retry. The build printed the sizes: | Path | Uncompressed | |---|---| | `/opt/pre-commit` | 377 MB | | `repo91aq4otb`, `repoyc4c93bl` (gitleaks, actionlint) | 176 MB, 172 MB | | `/opt/python` | 121 MB | | `/opt/venv` | 98 MB | pre-commit downloads a Go toolchain into `<env>/.go` for each Go hook and keeps it; at run time only the built binaries in `<env>/bin` run. ## Change (`images/ci/Dockerfile` only) - Run the `yamllint`, `gitleaks` and `actionlint` hooks on a staged sample, delete `repo*/golangenv-*/.go` and the Go build cache, then run the three hooks again. An incomplete or broken cache fails the image build, not the jobs. Expected `/opt/pre-commit` size: roughly 40 MB. - The `python3.X` symlink loop ran under `sh -c` without `-e`, so only the last iteration decided the status; the RUN now starts with `set -eu`. ## Verification `image.yml` only runs on `main`, so the next push builds it. If a layer is still over the limit, the 413 log will show it; the venv (98 MB) and interpreters (121 MB) should compress to well under 100 MB each. Nothing consumes the image yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-10-25 10:57:51 +00:00
fix(image): drop the Go toolchains from the ci image's hook cache
Lint / lint (pull_request) Successful in 1m23s
Build / build (pull_request) Successful in 51s
8078477a4b
The first push of mortis/ci failed with 413 Payload Too Large: the
/opt/pre-commit layer was 377 MB, of which two environments of 172 and
176 MB (gitleaks and actionlint) each hold their own Go toolchain
(pre-commit keeps <env>/.go; only the built binaries in <env>/bin run).

Run the yamllint, gitleaks and actionlint hooks on a staged sample, delete
the toolchains and the Go build cache, and run the three hooks again, so a
cache that no longer works fails the build instead of the jobs.

Also stop the python3.X symlink loop from hiding a broken link (the RUN had
no -e, so only the last iteration decided the status).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 approved these changes 2026-10-25 11:13:45 +00:00
Defame1297 merged commit 03d2c1dc91 into main 2026-10-25 11:13:49 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#4