From 298725fd02c6ef8bc53ccee914017ca54f587e68 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 19 Aug 2024 17:47:25 -0500 Subject: [PATCH] Improvements to the Docker installation guide (#6216) --- docs/getting-started/installation.md | 4 ++-- docs/guides/integration/docker.md | 25 ++++++++++++++++++++++--- pyproject.toml | 2 ++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 101b13541..f219a9536 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -34,11 +34,11 @@ By default, uv is installed to `~/.cargo/bin`. Request a specific version by including it in the URL: ```console title="macOS and Linux" -$ curl -LsSf https://astral.sh/uv/0.2.11/install.sh | sh +$ curl -LsSf https://astral.sh/uv/0.2.37/install.sh | sh ``` ```console title="Windows" -$ powershell -c "irm https://astral.sh/uv/0.2.11/install.ps1 | iex" +$ powershell -c "irm https://astral.sh/uv/0.2.37/install.ps1 | iex" ``` !!! tip diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index d63af1926..077eda788 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -18,18 +18,37 @@ FROM python:3.12-slim-bullseye COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv ``` -Or with the standalone installer: +Or, with the installer: ```dockerfile title="Dockerfile" FROM python:3.12-slim-bullseye + +# The installer requires curl (and certificates) to download the release archive RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates -RUN curl -LsSf https://astral.sh/uv/install.sh > /tmp/uv-installer.sh && sh /tmp/uv-installer.sh && rm /tmp/uv-installer.sh + +# Download the latest installer +ADD https://astral.sh/uv/install.sh /uv-installer.sh + +# Run the installer then remove it +RUN sh /uv-installer.sh && rm /uv-installer.sh + +# Ensure the installed binary is on the `PATH` ENV PATH="/root/.cargo/bin/:$PATH" ``` Note this requires `curl` to be available. -In either case, it is best practice to pin to a specific uv version. +In either case, it is best practice to pin to a specific uv version, e.g., with: + +```dockerfile +COPY --from=ghcr.io/astral-sh/uv:0.2.37 /uv /bin/uv +``` + +Or, with the installer: + +```dockerfile +ADD https://astral.sh/uv/0.2.37/install.sh /uv-installer.sh +``` ## Installing a package diff --git a/pyproject.toml b/pyproject.toml index 054720b51..c0b9d28b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,8 @@ version_files = [ "README.md", "crates/uv/Cargo.toml", "crates/uv-version/Cargo.toml", + "docs/getting-started/installation.md", + "docs/guides/integration/docker.md", "docs/guides/integration/pre-commit.md", "docs/guides/integration/github.md", ]