Skip to content

Commit 2f11a19

Browse files
committed
Fix Dockerfile installing uv
1 parent 38ff9d5 commit 2f11a19

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
# The devcontainer should use the developer target and run as root with podman
2-
# or docker with user namespaces.
1+
# Use this version of Python
32
ARG PYTHON_VERSION=3.12
4-
FROM python:${PYTHON_VERSION} AS developer
5-
63
# Use this version of uv
74
ARG UV_VERSION=0.7
85

6+
# Install uv using the official image
7+
# See https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
8+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv-distroless
9+
10+
# The devcontainer should use the developer target and run as root with podman
11+
# or docker with user namespaces.
12+
FROM python:${PYTHON_VERSION} AS developer
13+
914
# Add any system dependencies for the developer/build environment here
1015
# RUN apt-get update && apt-get install -y --no-install-recommends \
1116
# graphviz
1217

13-
# Install uv using the official image
14-
# See https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
15-
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
18+
# Install from uv image
19+
COPY --from=uv-distroless /uv /uvx /bin/
1620

1721
# The build stage installs the context into the venv
1822
FROM developer AS build
@@ -41,7 +45,7 @@ FROM python:${PYTHON_VERSION}-slim AS runtime
4145
# Add apt-get system dependecies for runtime here if needed
4246

4347
# We need to keep the venv at the same absolute path as in the build stage
44-
COPY --from=build /context/venv/ /context/venv/
48+
COPY --from=build /context/.venv/ /context/venv/
4549
ENV PATH=/context/venv/bin:$PATH
4650

4751
# Change this entrypoint if it is not the same as the repo

0 commit comments

Comments
 (0)