chore(docker): harden python 3.12 base image for snyk#103
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Hardens the Docker image to address Snyk findings by pinning the Python base image to a specific Debian release and applying available security upgrades during build.
Changes:
- Pin base image from
python:3.12-slimtopython:3.12-alpine3.22. - Add
apk update && apk upgrade(with apt list cleanup) to pick up OS-level security patches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
605c2d5 to
b7fcbd1
Compare
|
agjharms
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request updates the Docker build process and improves test compatibility with custom logging. The most significant changes include switching to an Alpine-based Python image for the Docker build and ensuring test loggers are compatible with XNATPy's logging expectations.
Docker build improvements:
Dockerfilefrompython:3.12-slimtopython:3.12-alpine3.22for a smaller and potentially more secure image, and updated the user creation command to use Alpine'sadduser. Also added explicitapk updateandapk upgradesteps for package freshness.Test logging compatibility:
tests/img2catalog/xnatpy_fixtures.py, added averbosealias to the logger if it doesn't exist, ensuring compatibility with XNATPy's custom logging calls during tests.The help of Github Copilot was used in making this PR