Repository navigation
Closed
Labels
Description
--dockerfile-inputs reads RUN pip install -r FILE only. Images that install with uv get an error:
FROM python:3.14-slim
COPY --from=ghcr.io/astral-sh/uv:0.13.9 /uv /uvx /bin/
WORKDIR /app
COPY requirements.txt .
RUN uv pip install --system --no-cache -r requirements.txt$ wheelgap --dockerfile Dockerfile --dockerfile-inputs
wheelgap: error: Dockerfile:5: only `RUN pip install -r FILE` and system package commands (apt-get, apk, dnf...) are read by --dockerfile-inputs, and this RUN may change what pip installs
The COPY --from on line 2 is refused as well (_read_copy() reads only --chown, --chmod and --link). This is one of the steps left from #496.
Where
src/wheelgap/dockerfile.py: _pip_install_files() decides what a RUN installs, and _read_copy() refuses every COPY --from.
What to do
- Read
uv pip install --system -r FILE(one or more-r FILE), with--no-cacheand--no-cache-dirignored.--systemis required: without it uv installs into a virtual environment, and which one depends on things wheelgap doesn't read. Refuse every other uv flag with its line, as pip flags are refused. - Read one
COPY --from: the documented way to get uv into an image,COPY --from=ghcr.io/astral-sh/uv[:TAG][@DIGEST] /uv [/uvx] DEST/. It copies only those binaries, so it can't bring in a requirements file or a pip config. Any otherCOPY --fromkeeps today's error. - uv reads its own settings. Treat a
uv.tomlor apyproject.tomlcopied into the image, and anENV/ARGthat setsUV_variables, as today's code treats a pip config file: an error naming the line, because they may change what uv installs. (UV_variables are refused already.) - The file is checked as a requirements file is today. Say in the stderr note which installer the line used (
Dockerfile:5: RUN uv pip install -r reads requirements.txt). - Later:
uv pip installof plain requirement arguments, anduv sync(its own issue).
Done when:
- Tests in
tests/test_dockerfile.pycover: the form above;uv pip installwithout--system(refused); another uv flag (refused);COPY --fromof the uv binaries to/bin/and/usr/local/bin/; aCOPY --fromof anything else (refused, as now); a copieduv.toml(refused). - The rows for the Dockerfile above equal the rows of
wheelgap requirements.txtwith the image's Python and platform. docs/cli.mdsays what is read. A CHANGELOG line goes under## Unreleased.
Activity
kunalkshah1 commentedon Nov 21, 2026
I opened #625. The regression tests check the documented uv binary COPY into both /bin/ and /usr/local/bin/, and compare the resulting report with a direct requirements check.