Skip to content

Commit 6b988a6

Browse files
authored
Merge pull request #134 from uptick/plt-1085/fix-gitops-on-graviton-instances
Make sure to pull the right uv image for the target architecture
2 parents 3e3399c + 5f325cd commit 6b988a6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Stage 1: Define a minimal stage to extract the 'uv' binary
2+
# This is a multi-stage build to use uv for dependency management and is necessary to ensure the the image version we pull is for the right architecture.
3+
# This is automatically set by the buildx builder. when using --platoform linux/amd64,linux/arm64 argument and then
4+
# using FROM in the Dockerfile.
5+
FROM ghcr.io/astral-sh/uv:0.4.0 AS uv_extractor
6+
7+
8+
# Stage 2: The main application build stage
19
FROM python:3.12-slim
210

311
ARG TARGETARCH
@@ -39,7 +47,11 @@ ENV SHELL=/bin/bash
3947
## Install dependencies and copy GitOps server.
4048
##
4149
WORKDIR /app
42-
COPY --from=ghcr.io/astral-sh/uv:0.4.0 /uv /bin/uv
50+
51+
52+
53+
# Copy the uv binary from the uv image to the final image.
54+
COPY --from=uv_extractor /uv /bin/uv
4355
COPY --link=true pyproject.toml uv.lock /app/
4456
RUN --mount=type=cache,target=/root/.cache/ \
4557
(uv sync --frozen --no-install-project --extra server || uv sync --frozen --no-install-project --extra server)

0 commit comments

Comments
 (0)