-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Java version labels to Java distroless images #276
Comments
Potentially 2 ways to do this without executing java/dpkg:
|
I've briefly thought about this. The current repo setup downloads the entire metadata list of all the packages from a certain Debian snapshot archive (for example, the metadata list file is https://snapshot.debian.org/archive/debian/20190125T150847Z/dists/stretch/main/binary-amd64/Packages.gz). The setup actually downloads and unpacks such a file and parses it. (In the end, it parses it into a JSON.) It is easy to check the contents of the metadata manually:
The actual code that does this is |
BTW, here's basically what's happening in this repo.
Then the script above will download/generate the following files:
A different set of flags can be used as well (which are being used for the
|
Looking into the |
I don't think the Debian packages provide the https://debian.pkgs.org/9/debian-main-amd64/openjdk-8-jre-headless_8u181-b13-2~deb9u1_amd64.deb.html |
I looked at the other significant Java images on Docker Hub, and also looked at Official Docker Images for other languages, and compiled a list of container metadata including labels and environment variables (see details below). The Official Docker Images for Java ( So although I support defining labels, we should also define a With respect to labels, in GoogleContainerTools/jib#1402 I found that OCI defines
|
#291 adds a It's easy to add labels to a + labels = {
+ "jdk.version": jre_ver(versions[jre_deb]),
+ "jdk.vendor": "openjdk",
+ "jdk.source": jre_deb + " " + versions[jre_deb],
+ }, |
Oops, meant to mention that
|
The following two labels are expected to be added:
jdk.vendor
: the vendor of the JDK.jdk.version
: the version of the JDK, e.g., 1.8.0_131 or 9.0.1 that can be obtained byjava -version
.@coollog @loosebazooka
The text was updated successfully, but these errors were encountered: