You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
outputs: type=image,name=python-container-builder,annotation-index.org.opencontainers.image.description=build your Python distroless containers with this
Copy file name to clipboardExpand all lines: README.md
+64-8Lines changed: 64 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,48 @@
3
3
4
4
A shortcut to packaging your Python code with requirement dependencies into a Distroless image.
5
5
6
+
## Supported Python Versions
7
+
8
+
This project provides pre-built images for multiple Python versions, using a hybrid approach that extracts Python from official images and installs it on a clean, customizable Debian base:
9
+
10
+
| Python Version | Image Tag | Python Source | Debian Base | Distroless Runtime |
> **Note**: When using Python 3.9 or 3.10, make sure to use `gcr.io/distroless/python3-debian11` as your runtime image. For Python 3.11 and above, use `gcr.io/distroless/python3-debian12`.
86
+
31
87
### Usage/Explanation
32
-
1.Declare the base image as the top FROM line in your Dockerfile.
33
-
2. Copy your requirements or configuration files from your application repo, and run pip installfrom a virtualenv.
34
-
3. Declare the final distroless container image you'll use for runtime.
88
+
1.Choose your Python version and declare the corresponding base image as the top FROM line in your Dockerfile (e.g., `:3.12`, `:3.14`, or `:latest`).
89
+
2. Copy your requirements or configuration files from your application repo, and run `uv pip install` (or `pip install`) from a virtualenv.
90
+
3. Declare the final distroless container image you'll use for runtime, matching the Debian version to your Python version (see table above).
35
91
4. Copy the virtualenv you built in the first phase of the build.
36
92
5. Move your application files to the proper location on the filesystem, and setup your workdir and entrypoint. All done!
0 commit comments