Skip to content

Keep Poetry's and pip's download caches out of the image - #308

Merged
adamjohnwright merged 1 commit into
mainfrom
slim-image
Oct 3, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
slim-image

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

poetry install leaves its download cache in the layer it runs in. I measured it in the image beta runs now (0544fc9): ~/.cache/pypoetry is 752M and ~/.cache/pip is 26M. That is roughly 780M per image, and the dev host keeps two images (live and rollback) on the disk that has repeatedly blocked deploys.

The caches are removed in the same RUN that creates them. A separate rm in a later layer would hide them but still ship them.

PyTorch stays: sentence-transformers needs it, and its pin is deliberate.

I couldn't build this locally because the host has no buildx. CI's docker-build job builds it, and the build's own self-check (it imports agent.graph) still runs. After the merge I'll check the pushed image has no .cache/pypoetry and compare its size.

🤖 Generated with Claude Code

poetry install leaves its download cache in ~/.cache/pypoetry, in the
same layer. Measured in the current image: 752M of Poetry cache and 26M
of pip's, about 780M per image. The dev host keeps two (live and rollback)
on the disk that has been the binding constraint on deploys. Removed in
the layer that made them; a later rm would hide them but still ship them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit ed0329f into main Oct 3, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the slim-image branch October 3, 2026 18:56
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.

1 participant