astral-sh / astral-sh/uv-docker-example
How to share the dependency layer between version updates
- Dominant language
- Dockerfile
- Stars
- 809
- Forks
- 84
- PR merge metrics
- No merged PRs in 30d
Description
The dependency layer will be invalidated when `pyproject.toml` changes. But the dependencies usually remain unchanged when a project bumps version. How to share the dependency layer between version updates?
https://docs.docker.com/build/cache/invalidation/#general-rules
https://github.com/astral-sh/uv-docker-example/blob/6473a50c02f9c36dda8c29cf3e0b6fd84839d353/Dockerfile#L13-L17
Contributor guide
No contributing guide indexed for this repository
Research direction
Read Dockerfile lines 13-17 and the linked Docker cache invalidation guidance first. Determine how the example can preserve the dependency layer when only the project version changes, then verify that the resulting image build reuses that layer across version updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100