Hey!
Here I am again with a suggestion for the UV feature.
It might be out of scope for this feature, but still thought it might be worth posing here.
I tend to use a dev container per project, and quite often have to rebuild my devcontainers. However, the way UV is currently setup, each rebuild of a devcontainer means a lot of data usage due to the large size of my python dependencies that are not persistent over builds.
I was wondering if it would be possible to allow this feature to share the uv cache as a persistent docker volume between builds, just like UV suggests with their uv docker example and documentation:
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
I think it would be nice if this would be supported (with optional argument) through this feature, as it could mean a lot less build time / data usage, without needing a lot of thinkering by users themselves like i currently am doing.
Currently i do this in the docker container myself with the following code in my devcontainer.json:
"mounts": [
"source=devcontainer_uv_cache,target=/.cache/uv,type=volume"
],
"remoteEnv": {
"UV_LINK_MODE": "copy",
"UV_CACHE_DIR": "/.cache/uv"
},
Together with a post createscript that executes afterward due to devcontainers and mounting permissions being iffy
sudo chown -R "$(whoami)": /.cache/uv
With my setup I share the cache between all my devcontainers, but one could also go for the cache mount type if you only want to share it with the specific devcontainer.
An example how that could look like in this feature could be found here in a feature that persist shell history to a docker mount
Hey!
Here I am again with a suggestion for the UV feature.
It might be out of scope for this feature, but still thought it might be worth posing here.
I tend to use a dev container per project, and quite often have to rebuild my devcontainers. However, the way UV is currently setup, each rebuild of a devcontainer means a lot of data usage due to the large size of my python dependencies that are not persistent over builds.
I was wondering if it would be possible to allow this feature to share the uv cache as a persistent docker volume between builds, just like UV suggests with their uv docker example and documentation:
RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --no-devI think it would be nice if this would be supported (with optional argument) through this feature, as it could mean a lot less build time / data usage, without needing a lot of thinkering by users themselves like i currently am doing.
Currently i do this in the docker container myself with the following code in my
devcontainer.json:Together with a post createscript that executes afterward due to devcontainers and mounting permissions being iffy
sudo chown -R "$(whoami)": /.cache/uvWith my setup I share the cache between all my devcontainers, but one could also go for the cache mount type if you only want to share it with the specific devcontainer.
An example how that could look like in this feature could be found here in a feature that persist shell history to a docker mount