From eb8ffa4981b54c4c31b5e83e253d2686404e1941 Mon Sep 17 00:00:00 2001 From: Danilo Rezende <50598421+returnDanilo@users.noreply.github.com> Date: Wed, 29 Jan 2025 21:17:58 -0300 Subject: [PATCH] Update documentation for running in a container (#11052) This PR rewords the instructions for using uv in a container. I'm a new user and was somewhat confused by it, so I've rewritten it as I'd have liked to have read it. It makes it more clear what distroless means, to avoid confusion with other projects that ship OS files with an image with its tag name clear of qualifiers(`astral-sh/uv`, in this case). An example of that is caddy, which ships with alpine. This also modifies the original example to use a distroful image instead of distroless one while #8635 doesn't get resolved. --------- Co-authored-by: Zanie Blue --- docs/guides/integration/docker.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 5ef454b79..a94234e84 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -14,25 +14,28 @@ description: Check out the [`uv-docker-example`](https://github.com/astral-sh/uv-docker-example) project for an example of best practices when using uv to build an application in Docker. -### Running uv in a container +uv provides both _distroless_ Docker images, which are useful for +[copying uv binaries](#installing-uv) into your own image builds, and images derived from popular +base images, which are useful for using uv in a container. The distroless images do not contain +anything but the uv binaries. In contrast, the derived images include an operating system with uv +pre-installed. -A Docker image is published with a built version of uv available. To run a uv command in a -container: +As an example, to run uv in a container using a Debian-based image: ```console -$ docker run ghcr.io/astral-sh/uv --help +$ docker run --rm -it ghcr.io/astral-sh/uv:debian uv --help ``` ### Available images -uv provides a distroless Docker image including the `uv` binary. The following tags are published: +The following distroless images are available: - `ghcr.io/astral-sh/uv:latest` - `ghcr.io/astral-sh/uv:{major}.{minor}.{patch}`, e.g., `ghcr.io/astral-sh/uv:0.5.25` - `ghcr.io/astral-sh/uv:{major}.{minor}`, e.g., `ghcr.io/astral-sh/uv:0.5` (the latest patch version) -In addition, uv publishes the following images: +And the following derived images are available: - Based on `alpine:3.20`: @@ -67,7 +70,7 @@ In addition, uv publishes the following images: - `ghcr.io/astral-sh/uv:python3.8-bookworm-slim` -As with the distroless image, each image is published with uv version tags as +As with the distroless image, each derived image is published with uv version tags as `ghcr.io/astral-sh/uv:{major}.{minor}.{patch}-{base}` and `ghcr.io/astral-sh/uv:{major}.{minor}-{base}`, e.g., `ghcr.io/astral-sh/uv:0.5.25-alpine`.