Skip to content

[CI / BUGFIX] Fixed disagreeing uv versions across project#958

Open
calumbell wants to merge 4 commits into
open5e:stagingfrom
calumbell:dockerfile-uv-version-fix
Open

[CI / BUGFIX] Fixed disagreeing uv versions across project#958
calumbell wants to merge 4 commits into
open5e:stagingfrom
calumbell:dockerfile-uv-version-fix

Conversation

@calumbell

Copy link
Copy Markdown
Contributor

Description

This PR fixes a bug I encountered with our CI pipeline while authoring #956. To quote from issue #957, here is the error message thrown by the Github Actions CI pipeline:

#10 ERROR: process "/bin/sh -c uv sync --frozen --no-dev --no-install-project" did not complete successfully: exit code: 2
------
 > [builder 4/7] RUN uv sync --frozen --no-dev --no-install-project:
0.184 error: Required uv version `>=0.10` does not match the running version `0.9.30`
------

So we had an issue here where our Dockerfile was running a different uv version (0.9.30) to the rest of the project (>=0.10), and this was causing the Docker build process to fail.

I had a dig around, and found that these issues are fairly well documented here: https://docs.astral.sh/uv/guides/integration/docker

This issue was with this specific line:

FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim AS builder

Combined uv/python build images were discontinued after uv version 0.9, which is why this line is setting the uv version to 0.9.30, out of step with the rest of the project.

The documents suggest the following as a solution:

FROM python:3.11-slim-bookworm AS builder

COPY --from=ghcr.io/astral-sh/uv:0.11.11 /uv /uvx /usr/local/bin/

Which pulls the uv binaries into the Docker build stage, which replicates how the deprecated bookworm combined images used to work.

Related Issue

Closes #957

How was this tested?

  • Docker image builds on local
  • CI tests all passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error generating Docker image

1 participant