Skip to content

How to share the dependency layer between version updates #61

@Nugine

Description

@Nugine

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

# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions