Skip to content

Commit 860a5a9

Browse files
authored
Merge pull request #2023 from GoogleContainerTools/byebyejava12
Remove java debian12 builds
2 parents 54966a0 + b80e284 commit 860a5a9

26 files changed

+46
-1985
lines changed

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ busybox.archive()
4343
use_repo(busybox, "busybox_amd64", "busybox_arm", "busybox_arm64", "busybox_ppc64le", "busybox_riscv64", "busybox_s390x")
4444

4545
### JAVA ###
46-
include("//private/repos/java_temurin:java.MODULE.bazel")
4746

4847
### NODE ###
4948
node = use_extension("//private/extensions:node.bzl", "node")

MODULE.bazel.lock

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

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ Any other tags are considered deprecated and are no longer updated
3838
| gcr.io/distroless/base-nossl-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
3939
| gcr.io/distroless/cc-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
4040
| gcr.io/distroless/python3-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64 |
41-
| gcr.io/distroless/java-base-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
42-
| gcr.io/distroless/java17-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
43-
| gcr.io/distroless/java21-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
4441
| gcr.io/distroless/nodejs20-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
4542
| gcr.io/distroless/nodejs22-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
4643
| gcr.io/distroless/nodejs24-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
@@ -56,6 +53,7 @@ Debian 13 distroless images use the debian [UsrMerge](https://wiki.debian.org/Us
5653
| gcr.io/distroless/base-nossl-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le, riscv64 |
5754
| gcr.io/distroless/cc-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le, riscv64 |
5855
| gcr.io/distroless/java-base-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
56+
| gcr.io/distroless/java17-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
5957
| gcr.io/distroless/java21-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
6058
| gcr.io/distroless/java25-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
6159
| gcr.io/distroless/nodejs20-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
@@ -218,7 +216,7 @@ $ docker run --entrypoint=sh -ti my_debug_image
218216
BUILD Dockerfile hello.py
219217
```
220218

221-
> Note: If the image you are using already has a tag, for example `gcr.io/distroless/java17-debian12:nonroot`, use the tag `debug-<existing tag>` instead, for example `gcr.io/distroless/java17-debian12:debug-nonroot`.
219+
> Note: If the image you are using already has a tag, for example `gcr.io/distroless/java17-debian13:nonroot`, use the tag `debug-<existing tag>` instead, for example `gcr.io/distroless/java17-debian13:debug-nonroot`.
222220
223221
> Note: [ldd](http://man7.org/linux/man-pages/man1/ldd.1.html) is not installed in the base image as it's a shell script, you can copy it in or download it.
224222

common/BUILD.bazel

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
load("@aspect_bazel_lib//lib:tar.bzl", "tar")
22
load("@rules_distroless//distroless:defs.bzl", "cacerts", "group", "home", "locale", "os_release", "passwd")
3-
load("//:distro.bzl", "ALL_ARCHITECTURES", "ALL_DISTROS", "VERSIONS")
3+
load("//:distro.bzl", "ALL_DISTROS", "VERSIONS")
44
load("//private/util:deb.bzl", "deb")
55
load(":variables.bzl", "NOBODY", "NONROOT", "OS_RELEASE", "ROOT", "quote")
66

77
package(default_visibility = ["//visibility:public"])
88

9-
COMMON_ARCHITECTURES = ALL_ARCHITECTURES
10-
119
COMMON_DISTROS = ALL_DISTROS
1210

11+
COMMON_ARCHITECTURES = {
12+
"debian12": [
13+
"amd64",
14+
"arm64",
15+
"arm",
16+
"s390x",
17+
"ppc64le",
18+
],
19+
"debian13": [
20+
"amd64",
21+
"arm64",
22+
"arm",
23+
"s390x",
24+
"ppc64le",
25+
"riscv64",
26+
],
27+
}
28+
1329
tar(
1430
name = "rootfs",
1531
srcs = [],
@@ -53,17 +69,17 @@ tar(
5369
charset = "C.utf8",
5470
package = deb.data(arch, distro, "libc-bin"),
5571
)
56-
for arch in COMMON_ARCHITECTURES
5772
for distro in COMMON_DISTROS
73+
for arch in COMMON_ARCHITECTURES[distro]
5874
]
5975

6076
[
6177
cacerts(
6278
name = "cacerts_%s_%s" % (distro, arch),
6379
package = deb.data(arch, distro, "ca-certificates"),
6480
)
65-
for arch in COMMON_ARCHITECTURES
6681
for distro in COMMON_DISTROS
82+
for arch in COMMON_ARCHITECTURES[distro]
6783
]
6884

6985
# create /etc/group with the root, tty, and staff groups

examples/java/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load("//private/oci:defs.bzl", "java_image")
77
package(default_visibility = ["//visibility:public"])
88

99
JAVA_VERSIONS_PER_DISTRO = [
10-
("17", "debian12"),
10+
("17", "debian13"),
1111
]
1212

1313
[

examples/java/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44
RUN javac examples/*.java
55
RUN jar cfe main.jar examples.HelloJava examples/*.class
66

7-
FROM gcr.io/distroless/java17-debian12
7+
FROM gcr.io/distroless/java17-debian13
88
COPY --from=build-env /app /app
99
WORKDIR /app
1010
CMD ["main.jar"]
File renamed without changes.
File renamed without changes.

java/BUILD

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
load(":java.bzl", "java_base_image", "java_base_image_index", "java_build_base_image", "java_image_index", "java_openjdk_image", "java_temurin_image_from_adoptium_debs", "java_temurin_image_from_github_releases")
2-
load(":config.bzl", "JAVA_ARCHITECTURES", "JAVA_BASE_PACKAGES", "JAVA_BUILD_BASE_PACKAGES", "JAVA_DISTROS")
1+
load(":java.bzl", "java_base_image", "java_base_image_index", "java_image", "java_image_index")
2+
load(":config.bzl", "JAVA_ARCHITECTURES", "JAVA_BASE_PACKAGES", "JAVA_DISTROS")
33

44
package(default_visibility = ["//visibility:public"])
55

6-
# unpublished build-base images (deprecated)
7-
[
8-
java_build_base_image(
9-
"debian12",
10-
arch,
11-
JAVA_BUILD_BASE_PACKAGES["debian12"],
12-
)
13-
for arch in JAVA_ARCHITECTURES["debian12"]
14-
]
15-
166
# publishable java base images
177
[
188
java_base_image(
@@ -32,17 +22,6 @@ package(default_visibility = ["//visibility:public"])
3222
for distro in JAVA_DISTROS
3323
]
3424

35-
# publishable java temurin images from github releases (deprecated)
36-
ADOPTIUM_GH_PER_DISTRO = [
37-
("21", "debian12"),
38-
]
39-
40-
[
41-
java_temurin_image_from_github_releases(distro, java_version, arch)
42-
for java_version, distro in ADOPTIUM_GH_PER_DISTRO
43-
for arch in JAVA_ARCHITECTURES[distro]
44-
]
45-
4625
# publishable java temurin images from adoptium deb repository
4726
ADOPTIUM_DEB_PER_DISTRO = [
4827
("17", "debian13"),
@@ -51,28 +30,17 @@ ADOPTIUM_DEB_PER_DISTRO = [
5130
]
5231

5332
[
54-
java_temurin_image_from_adoptium_debs(distro, java_version, arch)
33+
java_image(distro, java_version, arch)
5534
for java_version, distro in ADOPTIUM_DEB_PER_DISTRO
5635
for arch in JAVA_ARCHITECTURES[distro]
5736
]
5837

59-
# publishable java openjdk (from debian) images (deprecated)
60-
JAVA_OPENJDK_VERSIONS_PER_DISTRO = [
61-
("17", "debian12"),
62-
]
63-
64-
[
65-
java_openjdk_image(distro, java_version, arch)
66-
for java_version, distro in JAVA_OPENJDK_VERSIONS_PER_DISTRO
67-
for arch in JAVA_ARCHITECTURES[distro]
68-
]
69-
7038
# all image indexes
7139
[
7240
java_image_index(
7341
distro,
7442
java_version,
7543
JAVA_ARCHITECTURES[distro],
7644
)
77-
for java_version, distro in JAVA_OPENJDK_VERSIONS_PER_DISTRO + ADOPTIUM_GH_PER_DISTRO + ADOPTIUM_DEB_PER_DISTRO
45+
for java_version, distro in ADOPTIUM_DEB_PER_DISTRO
7846
]

java/README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This image contains a minimal Linux, OpenJDK-based runtime.
66

77
Specifically, the image contains everything in the [base image](../base/README.md), plus:
88

9-
* OpenJDK 17 (`gcr.io/distroless/java17-debian12`) and its dependencies.
10-
* Temurin OpenJDK 21 (`gcr.io/distroless/java21-debian12`) and its dependencies
9+
* Temurin OpenJDK 17 (`gcr.io/distroless/java17-debian13`) and its dependencies.
10+
* Temurin OpenJDK 21 (`gcr.io/distroless/java21-debian13`) and its dependencies
1111
* Temurin OpenJDK 25 (`gcr.io/distroless/java25-debian13`) and its dependencies
1212

1313
## Usage
@@ -16,11 +16,9 @@ The entrypoint of this image is set to the equivalent of "java -jar", so this im
1616

1717
## Add another JAVA version
1818

19-
To support JAVA version you need to do the following steps:
20-
- Create a new file `java_{newVersion}.MODULE.bazel` in the [java_temurin](private/repos/java_temurin) folder based on the latest created.
21-
- In the file, you must specify the tar.gz files used to build the images, ideally from this URL: `https://github.com/adoptium/temurin{newVersion}-binaries/releases`.
22-
- Add the new names in the [java.MODULE.bazel](private/repos/java_temurin/java.MODULE.bazel) file.
23-
- Add two yaml files in the [java/testdata](java/testdata) folder to prepare the tests, you can take inspiration on the other files.
24-
- Add the new version in `JAVA_TEMURIN_VERSIONS` and `JAVA_TEMURIN_VERSIONS_PER_DISTRO` (must be debian13 starting from Java 25).
19+
To support a new JAVA version you need to do the following steps:
20+
- Add the new version to `ADOPTIUM_DEB_PER_DISTRO` in [java/BUILD](BUILD).
21+
- Add the new version to `JAVA_MAJOR_VERSIONS` in [java/config.bzl](config.bzl).
22+
- Add two yaml files in the [java/testdata](testdata) folder to prepare the tests, you can take inspiration on the other files.
2523

26-
You can then ensure everything works on this folder with `bazel build //java:...`
24+
You can then ensure everything works on this folder with `bazel build //java:...`

0 commit comments

Comments
 (0)