uv icon indicating copy to clipboard operation
uv copied to clipboard

Publish Docker image: ghcr.io/astral-sh/uv

Open bschoenmaeckers opened this issue 1 year ago • 4 comments

There is a Dockerfile available in the repo but it is not (yet) published to the package registry.

bschoenmaeckers avatar Apr 02 '24 13:04 bschoenmaeckers

We had this during development but turned it off on launch — to be revisited.

Can you share more about your use-case for the image?

zanieb avatar Apr 02 '24 19:04 zanieb

I would like to use it in a slim docker image like shown below, this way docker will cache the latest uv binary but does not include it into the final image.

FROM ghcr.io/astral-sh/uv as uv
FROM python:alpine
RUN --mount=type=cache,target=/root/.cache/uv \
        --mount=from=uv,source=/uv,target=./uv \
        ./uv pip install .....

bschoenmaeckers avatar Apr 03 '24 09:04 bschoenmaeckers

Yeah, much easier and efficient installation method when working with containers!

I'm currently doing a pip install and pulling that binary in multi-stage, just to avoid installing curl for the install script. That mostly just tries to figure the current OS and arch, but with a multi-platformat container images that's handled automatically already. Also, pulling from uv and python base image can be done in parallel here, while doing the install in a RUN doesn't.

helderco avatar Apr 05 '24 13:04 helderco

cc @charliermarsh who has more context on how hard it would be to enable this again

zanieb avatar Apr 05 '24 14:04 zanieb

It would also be nice to have an image with the latest python for building wheels in the CI.

uv pip install build[uv] twine
python -m build --installer uv
python -m twine upload dist/*

bschoenmaeckers avatar Apr 06 '24 08:04 bschoenmaeckers

You can use multi stage to copy uv into any image. That'll keep the uv image as small as possible for faster download.

helderco avatar Apr 06 '24 11:04 helderco

It's great that this is in 🙌

Can you tag the image with the release version though? That would help with pinning.

helderco avatar Apr 23 '24 13:04 helderco

We will, there was just a permissions issue in the last release #3195

zanieb avatar Apr 23 '24 14:04 zanieb