Skip to content

Commit 5f935e9

Browse files
committed
First python3-debian13 images for testing
- Remove distutils dep and add venv. I'm not sure this is sufficient for all python users, but hopefully it will be. - Not too many changes otherwise Signed-off-by: Appu Goundan <appu@google.com>
1 parent a20c346 commit 5f935e9

File tree

16 files changed

+801
-153
lines changed

16 files changed

+801
-153
lines changed

BUILD

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,16 @@ PYTHON3 |= {
149149
for (tag_base, debug_mode, user) in VARIANTS
150150
}
151151

152-
# python on debian12 has moved out of experimental
153152
PYTHON3 |= {
154-
"{REGISTRY}/{PROJECT_ID}/python3-debian12:" + tag_base + "-" + arch: "//python3:python3" + debug_mode + "_" + user + "_" + arch + "_" + distro
153+
"{REGISTRY}/{PROJECT_ID}/python3-" + distro + ":" + tag_base + "-" + arch: "//python3:python3" + debug_mode + "_" + user + "_" + arch + "_" + distro
155154
for distro in PYTHON_DISTROS
156155
for arch in PYTHON_ARCHITECTURES[distro]
157156
for (tag_base, debug_mode, user) in VARIANTS
158157
}
159158

160159
# oci_image_index
161160
PYTHON3 |= {
162-
"{REGISTRY}/{PROJECT_ID}/python3-debian12:" + tag_base: "//python3:python3" + debug_mode + "_" + user + "_" + distro
161+
"{REGISTRY}/{PROJECT_ID}/python3-" + distro + ":" + tag_base: "//python3:python3" + debug_mode + "_" + user + "_" + distro
163162
for distro in PYTHON_DISTROS
164163
for (tag_base, debug_mode, user) in VARIANTS
165164
}

MODULE.bazel.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ Debian 13 distroless images use the debian [UsrMerge](https://wiki.debian.org/Us
6565
| gcr.io/distroless/nodejs22-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
6666
| gcr.io/distroless/nodejs24-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
6767

68+
#### Debian 13 (preview)
69+
70+
Images that are still being worked on
71+
72+
| Image | Tags | Architecture Suffixes |
73+
| ------------------------------------- | ------------------------------------- | --------------------------------- |
74+
| gcr.io/distroless/python3-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64 |
75+
6876
## Why is distroless still using `gcr.io` instead of `pkg.dev`?
6977

7078
Distroless's serving infrastructure has moved to artifact registry but we still use the `gcr.io` domain. Users will get the benefits of the newer infrastructure without changing their builds.

examples/python3/BUILD

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ pkg_tar(
1111
)
1212

1313
# This example runs a python program that walks the filesystem under "/etc" and prints every filename.
14-
oci_image(
15-
name = "hello_debian12",
16-
base = "//python3:python3_root_amd64_debian12",
17-
cmd = [
18-
"hello.py",
19-
"/etc",
20-
],
21-
tars = [
22-
":hello_py",
23-
],
24-
)
14+
[
15+
oci_image(
16+
name = "hello_" + distro,
17+
base = "//python3:python3_root_amd64_" + distro,
18+
cmd = [
19+
"hello.py",
20+
"/etc",
21+
],
22+
tars = [
23+
":hello_py",
24+
],
25+
)
26+
for distro in DISTROS
27+
]
2528

2629
# Run
2730
# podman load -i bazel-bin/examples/python3/tarball/tarball.tar

private/repos/deb/bookworm_python.lock.json

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
{
22
"packages": [
3-
{
4-
"arch": "amd64",
5-
"dependencies": [],
6-
"key": "dash_0.5.12-2_amd64",
7-
"name": "dash",
8-
"sha256": "33ea40061da2f1a861ec46212b2b6a34f0776a049b1a3f0abce2fb8cb994258f",
9-
"urls": [
10-
"https://snapshot.debian.org/archive/debian/20260110T225955Z/pool/main/d/dash/dash_0.5.12-2_amd64.deb"
11-
],
12-
"version": "0.5.12-2"
13-
},
143
{
154
"arch": "amd64",
165
"dependencies": [],
@@ -275,28 +264,6 @@
275264
],
276265
"version": "1:1.2.13.dfsg-1"
277266
},
278-
{
279-
"arch": "amd64",
280-
"dependencies": [],
281-
"key": "libc-bin_2.36-9-p-deb12u13_amd64",
282-
"name": "libc-bin",
283-
"sha256": "3f7a7caf9a34875fb076f08d168430ad8c338c71b0b7e6c02d19e914d7bc4277",
284-
"urls": [
285-
"https://snapshot.debian.org/archive/debian/20260110T225955Z/pool/main/g/glibc/libc-bin_2.36-9+deb12u13_amd64.deb"
286-
],
287-
"version": "2.36-9+deb12u13"
288-
},
289-
{
290-
"arch": "arm64",
291-
"dependencies": [],
292-
"key": "dash_0.5.12-2_arm64",
293-
"name": "dash",
294-
"sha256": "c1358e2a8054eb93efd460adf480224a16ea9e0b4d7b4c6cbcf8c8c91902a1d7",
295-
"urls": [
296-
"https://snapshot.debian.org/archive/debian/20260110T225955Z/pool/main/d/dash/dash_0.5.12-2_arm64.deb"
297-
],
298-
"version": "0.5.12-2"
299-
},
300267
{
301268
"arch": "arm64",
302269
"dependencies": [],
@@ -560,17 +527,6 @@
560527
"https://snapshot.debian.org/archive/debian/20260110T225955Z/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb"
561528
],
562529
"version": "1:1.2.13.dfsg-1"
563-
},
564-
{
565-
"arch": "arm64",
566-
"dependencies": [],
567-
"key": "libc-bin_2.36-9-p-deb12u13_arm64",
568-
"name": "libc-bin",
569-
"sha256": "1199da233e4c893e0a44e81b2024667241c19f93eb12f4ec1e29585117270a85",
570-
"urls": [
571-
"https://snapshot.debian.org/archive/debian/20260110T225955Z/pool/main/g/glibc/libc-bin_2.36-9+deb12u13_arm64.deb"
572-
],
573-
"version": "2.36-9+deb12u13"
574530
}
575531
],
576532
"version": 1

private/repos/deb/bookworm_python.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# debian 12, limited architectures, java only
1+
# debian 12, limited architectures, python only
22
version: 1
33

44
sources:
@@ -14,7 +14,6 @@ archs:
1414
- arm64
1515

1616
packages:
17-
- dash
1817
- libbz2-1.0
1918
- libcom-err2
2019
- libcrypt1 # TODO: glibc library for -lcrypt; maybe should be in cc?
@@ -39,4 +38,3 @@ packages:
3938
- python3-distutils
4039
- python3.11-minimal
4140
- zlib1g
42-
- libc-bin

private/repos/deb/deb.MODULE.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ REPOS = [
44
"trixie",
55
"trixie_java",
66
"trixie_adoptium",
7+
"trixie_python",
78
"bookworm",
89
"bookworm_java",
910
"bookworm_python",
@@ -24,7 +25,7 @@ apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt")
2425
for repo in REPOS
2526
]
2627

27-
use_repo(apt, "bookworm", "bookworm_java", "bookworm_python", "trixie", "trixie_java", "trixie_adoptium")
28+
use_repo(apt, "bookworm", "bookworm_java", "bookworm_python", "trixie", "trixie_java", "trixie_adoptium", "trixie_python")
2829

2930
### VERSIONS HUB REPO ###
3031
version = use_extension("//private/extensions:version.bzl", "version")

0 commit comments

Comments
 (0)