Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to the Docker installation guide #6216

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 22 additions & 3 deletions docs/guides/integration/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be worth having the same recommendation in GitHub integration documentation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably! Want to add it? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make a PR in a few hours yep :)


```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

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
Loading