Skip to content

Caching for managed python installations #15586

@aokellermann

Description

@aokellermann

Summary

The current guidance for caching in docker images is:

ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync

The UV_LINK_MODE=COPY is crucial, as the cache is not mounted during container runtime.

However, this only works for package cache, and not for managed python installations. So if my image doesn't have python already installed, uv downloads it and puts it in a non-cached filesystem (/root/.local/share/uv by default). It would be nice if there was some way to have a UV_LINK_MODE analog, but for managed python so that if one mounts a python cache, uv sync will copy python to the image filesystem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions