Skip to content

fix(docker): remove pip from runtime image - #33

Open
KingPin wants to merge 1 commit into
mainfrom
fix/remove-pip-from-image
Open

KingPin wants to merge 1 commit into
mainfrom
fix/remove-pip-from-image

Conversation

@KingPin

@KingPin KingPin commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Uninstalls pip after pip install -r requirements.txt in the same layer.

pip is not used at runtime. Its vendored packages raise 7 open Trivy alerts on main:

Upgrading pip to 26.3 would only fix 5 of these; it still vendors setuptools 70.3.0.

Verified locally:

  • image builds; import pip fails; all app dependencies import; --help runs
  • trivy image (MEDIUM+) reports only zlib 1.3.2-r1 CVE-2026-4738, which has no fixed package in Alpine 3.24 yet

pip is only needed to install requirements at build time. Its vendored
urllib3, msgpack and setuptools packages raised 7 Trivy alerts (5 HIGH)
on the published image. Uninstall it in the same layer as the install.
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.

1 participant