Skip to content

fix(docker): upgrade the base image's setuptools in the runtime stage - #870

Merged
Masterplanner25 merged 1 commit into
mainfrom
fix/docker-setuptools-floor
Nov 1, 2026
Merged

Masterplanner25 merged 1 commit into
mainfrom
fix/docker-setuptools-floor

Conversation

@Masterplanner25

Copy link
Copy Markdown
Owner

Owner's choice (a) from the #869 discussion: our image should ship the fixed setuptools, and setuptools stays out of the core dependencies.

Problem. The Dockerfile installs plain aindy-runtime==2.29.0, and setuptools's floor lives only in the security extra. The image therefore keeps python:3.11-slim's setuptools 79.0.1, which is below both CVE-2026-59890's floor (83.0.0) and GHSA-xmj3-9gf7-h52w's (84.1.0). There's no runtime exposure, since the runtime never imports setuptools; this is what an image scanner reports.

Fix. One step in the runtime stage, after COPY --from=builder /install /usr/local:

RUN pip install --no-cache-dir --upgrade "setuptools>=84.1.0"

Why not the obvious alternatives. Both were checked in throwaway two-stage builds.

Approach Result
aindy-runtime[security] in the builder also installs pip-audit into the production image, and has the copy problem below
newer setuptools in the builder, copied over /usr/local both setuptools-79.0.1.dist-info and -84.2.1.dist-info remain; pip list still says 79.0.1
upgrade in the runtime stage (this PR) only setuptools-84.2.1.dist-info; pip list says 84.2.1

Verified locally on the real Dockerfile (docker build --no-cache): the image reports aindy-runtime 2.29.0 and setuptools 84.2.1, with a single setuptools dist-info, no pip-audit, and a working aindy-runtime --help.

Changelog: changelog.d/870-docker-setuptools-floor.md. It takes effect from the next image build. The floor is duplicated from the security extra; the Dockerfile comment says to keep them equal.

The app's Dockerfile is single-stage with a direct pip install, so its [mcp,security] install already replaces 79.0.1 cleanly. No app change is needed.

🤖 Generated with Claude Code

python:3.11-slim ships setuptools 79.0.1, below the security extra's
floor, and the image installs plain aindy-runtime. Upgrade it in the
runtime stage: a builder install copied over /usr/local leaves both
dist-infos and pip list still reports 79.0.1. [security] declined, it
also installs pip-audit.

Verified by a local build: setuptools 84.2.1 is the only dist-info,
aindy-runtime 2.29.0, CLI runs, no pip-audit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Masterplanner25
Masterplanner25 force-pushed the fix/docker-setuptools-floor branch from 3b8a8d1 to d79c801 Compare October 30, 2026 04:15
@Masterplanner25
Masterplanner25 merged commit b595fc1 into main Nov 1, 2026
12 checks passed
@Masterplanner25
Masterplanner25 deleted the fix/docker-setuptools-floor branch November 1, 2026 20:21
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