-
-
Notifications
You must be signed in to change notification settings - Fork 703
chore: migrate dependency management from pip to uv for Docker containers
#2630
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
base: master
Are you sure you want to change the base?
Changes from all commits
3f3d957
b6cdb6d
79be710
660d85a
90e4be3
e588951
f75483a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,13 +21,13 @@ RUN npm run build | |
| {% endif %} | ||
| {% include 'Dockerfile.base.j2' %} | ||
|
|
||
| COPY requirements/requirements.txt /tmp/requirements.txt | ||
| COPY pyproject.toml uv.lock /tmp/ | ||
| {% if disable_cache_mounts %} | ||
| RUN \ | ||
| {% else %} | ||
| RUN --mount=type=cache,target=/root/.cache/pip \ | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| {% endif %} | ||
| pip3 install -r /tmp/requirements.txt --break-system-packages | ||
| cd /tmp && uv sync --frozen --no-dev --group server | ||
|
||
|
|
||
| RUN mkdir -p /usr/src/app | ||
| COPY . /usr/src/app/ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uvstage pulls a third-party build tool image using the mutablelatesttag, which creates a supply-chain risk: if that image is compromised or replaced in the registry, your builds will transparently consume and execute attacker-controlled code inside production images. Because this runs during image build with high privileges, an attacker controlling that tag could inject backdoors or exfiltrate secrets during builds. To mitigate this, pin theuvimage to an immutable reference (e.g., a specific version tag and preferably a digest) and update it deliberately as part of your release process.