Skip to content
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

Closed
liyinan926 opened this issue Jan 16, 2019 · 9 comments
Closed

Add Java version labels to Java distroless images #276

liyinan926 opened this issue Jan 16, 2019 · 9 comments
Assignees

Comments

@liyinan926
Copy link

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 by java -version.

@coollog @loosebazooka

@loosebazooka
Copy link
Member

@mattmoor @dlorenc is there way to extract "Version" from the pkg metadata and expose it as a label during build?

@loosebazooka
Copy link
Member

Potentially 2 ways to do this without executing java/dpkg:

  1. Version in filename: <package-name>_<version>_<architecture>.deb
  2. Package metadata from control Version: <version>
    • .debs seem to contain a control archive control.tar.gz with a control file control which contains this version.

@chanseokoh
Copy link
Member

chanseokoh commented Jan 25, 2019

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:

$ wget https://snapshot.debian.org/archive/debian/20190125T150847Z/dists/stretch/main/binary-amd64/Packages.gz
$ gunzip -c Packages.gz | grep "Package: openjdk-8"
Package: openjdk-8-dbg
Package: openjdk-8-demo
Package: openjdk-8-doc
Package: openjdk-8-jdk
Package: openjdk-8-jdk-headless
Package: openjdk-8-jre
Package: openjdk-8-jre-headless
Package: openjdk-8-jre-zero
Package: openjdk-8-source
Package: openjdk-8-jre-dcevm

The actual code that does this is package_manager/dpkg_parser.py and package_manager/parse_metadata.py. (However, seems like it pulls in a compiled dpkg_parser.par binary from a GCS bucket though.) I wonder if we can utilize this existing infrastructure. Might need some work though.

@chanseokoh
Copy link
Member

chanseokoh commented Jan 25, 2019

BTW, here's basically what's happening in this repo.

$ cp package_manager/dpkg_parser.py .
$ mkdir file
$ python2 dpkg_parser.py \
    --download-and-extract-only=true \
    --distro=stretch \
    --arch=amd64 \
    --snapshot=20190125T092538Z \
    --mirror-url=https://snapshot.debian.org/archive \
    --sha256=4b981bd2445d85cf1d93ea9f2d2dc235d20543ecdadd0d8065a10793b94eab9b

Then the script above will download/generate the following files:

Packages.gz   <-- this is the direct download of the metadata file
file/os_release.tar
file/Packages.json   <-- parsed into JSON
etc/os-release

A different set of flags can be used as well (which are being used for the debian-security archives).

$ python2 dpkg_parse.py \
    --download-and-extract-only=true \
    --package-prefix=https://snapshot.debian.org/archive/debian-security/20190125T092538Z/ \
    --packages-gz-url=https://snapshot.debian.org/archive/debian-security/20190125T092538Z/dists/stretch/updates/main/binary-amd64/Packages.gz \
    --sha256=0456053972f31b49f3975b878e3bfc4580daf6bf3d073e4f2da42282cae7d9fa

@chanseokoh
Copy link
Member

Looking into the $JAVA_HOME/release could work too.

@briandealwis
Copy link
Member

I don't think the Debian packages provide the /release file.

https://debian.pkgs.org/9/debian-main-amd64/openjdk-8-jre-headless_8u181-b13-2~deb9u1_amd64.deb.html

@briandealwis
Copy link
Member

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 (openjdk), PHP, Python, Node, and Ruby all define a LLLL_VERSION environment variable with the runtime version (where LLLL = {JAVA, PHP, PYTHON, NODE, PYTHON}). The openjdk builds use the Java version such as 8u192 or 11.0.2. AdoptOpenJDK also provide a JAVA_VERSION but it uses a form like jdk-11.0.2+13. Neither Azul Zulu (and Microsoft's variant of Zulu) nor Amazon Corretto provide any version metadata. None define any labels except for Fabric8's images which are actually inherited from their CentOS base image.

So although I support defining labels, we should also define a JAVA_VERSION in keeping with the Official OpenJDK Docker Image.

With respect to labels, in GoogleContainerTools/jib#1402 I found that OCI defines
a standard set of labels, based on the efforts of label-schema.org. and also defines set of rules for the format of these labels, including that the keys should use a reverse-domain-name format.

Image Source Java Location WorkingDir Entrypoint Cmd User Labels Env
openjdk:11 https://hub.docker.com/_/openjdk /docker-java-home jshell "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=11.0.1" "JAVA_DEBIAN_VERSION=11.0.1+13-2~bpo9+1"
openjdk:11-jre https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=11.0.1" "JAVA_DEBIAN_VERSION=11.0.1+13-2~bpo9+1"
openjdk:11-jre-alpine
openjdk:11-jre-slim https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=11.0.1" "JAVA_DEBIAN_VERSION=11.0.1+13-2~bpo9+1"
openjdk:10 https://hub.docker.com/_/openjdk /docker-java-home jshell "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=10.0.2" "JAVA_DEBIAN_VERSION=10.0.2+13-2"
openjdk:10-jre https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=10.0.2" "JAVA_DEBIAN_VERSION
openjdk:10-jre-alpine
openjdk:10-jre-slim https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=10.0.2" "JAVA_DEBIAN_VERSION=10.0.2+13-2"
openjdk:9 https://hub.docker.com/_/openjdk /docker-java-home jshell "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=9.0.4+12" "JAVA_DEBIAN_VERSION=9.0.4+12-4"
openjdk:9-jre https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=9.0.4+12" "JAVA_DEBIAN_VERSION=9.0.4+12-4"
openjdk:8 https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=8u181" "JAVA_DEBIAN_VERSION=8u181-b13-2~deb9u1"
openjdk:8-jre https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home/jre" "JAVA_VERSION=8u181" "JAVA_DEBIAN_VERSION=8u181-b13-2~deb9u1"
openjdk:8-jre-alpine https://hub.docker.com/_/openjdk /usr/lib/jvm/java-1.8-openjdk/jre /bin/sh "LANG=C.UTF-8" "JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre" "JAVA_VERSION=8u191" "JAVA_ALPINE_VERSION=8.191.12-r0"
openjdk:8-jre-slim https://hub.docker.com/_/openjdk /docker-java-home/jre bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home/jre" "JAVA_VERSION=8u181" "JAVA_DEBIAN_VERSION=8u181-b13-2~deb9u1"
openjdk:7 https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home" "JAVA_VERSION=7u181" "JAVA_DEBIAN_VERSION=7u181-2.6.14-2~deb8u1"
openjdk:7-jre https://hub.docker.com/_/openjdk /docker-java-home bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home/jre" "JAVA_VERSION=7u181" "JAVA_DEBIAN_VERSION=7u181-2.6.14-2~deb8u1"
openjdk:7-jre-alpine https://hub.docker.com/_/openjdk /usr/lib/jvm/java-1.7-openjdk/jre /bin/sh "LANG=C.UTF-8" "JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk/jre" "JAVA_VERSION=7u181" "JAVA_ALPINE_VERSION=7.181.2.6.14-r0"
openjdk:7-jre-slim https://hub.docker.com/_/openjdk /docker-java-home/jre bash "LANG=C.UTF-8" "JAVA_HOME=/docker-java-home/jre" "JAVA_VERSION=7u181" "JAVA_DEBIAN_VERSION=7u181-2.6.14-2~deb8u1"
adoptopenjdk/openjdk11 /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-11.0.2+9" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk11:alpine /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-11.0.2+9" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk11:slim /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-11.0.2+9" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk11:alpine-slim /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-11.0.2+9" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk11-openj9 /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-11.0.1+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle"
adoptopenjdk/openjdk11-openj9:slim /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-11.0.1+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle"
adoptopenjdk/openjdk11-openj9:alpine /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-11.0.1+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle"
adoptopenjdk/openjdk11-openj9:alpine-slim /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-11.0.1+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle"
adoptopenjdk/openjdk10 /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-10.0.2+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk10:alpine /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-10.0.2+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk10:slim /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-10.0.2+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk10:alpine-slim /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-10.0.2+13" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport"
adoptopenjdk/openjdk9 /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-9.0.4+11" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk9:alpine /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-9.0.4+11" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk9:slim /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk-9.0.4+11" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk9:alpine-slim /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk-9.0.4+11" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk8 /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk8u202-b08" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk8:alpine /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk8u202-b08" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk8:slim /opt/java/openjdk /bin/bash "JAVA_VERSION=jdk8u202-b08" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
adoptopenjdk/openjdk8:alpine-slim /opt/java/openjdk /bin/sh "JAVA_VERSION=jdk8u202-b08" "JAVA_HOME=/opt/java/openjdk" "JAVA_TOOL_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
azul/zulu-openjdk:11 https://hub.docker.com/r/azul/zulu-openjdk /usr/lib/jvm/zulu-11-amd64 /bin/bash "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-alpine:11 https://hub.docker.com/r/azul/zulu-openjdk-alpine /usr/lib/jvm/zulu11.2.3-jdk11.0.1-linux_musl_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-debian:11 https://hub.docker.com/r/azul/zulu-openjdk-debian /usr/lib/jvm/zulu-11-amd64 bash
azul/zulu-openjdk:8 https://hub.docker.com/r/azul/zulu-openjdk /usr/lib/jvm/zulu-8-amd64 /bin/bash "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-alpine:8 https://hub.docker.com/r/azul/zulu-openjdk-alpine /usr/lib/jvm/zulu8.33.0.1-jdk8.0.192-linux_musl_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-debian:8 https://hub.docker.com/r/azul/zulu-openjdk-debian /usr/lib/jvm/zulu-8-amd64 bash
azul/zulu-openjdk:7 https://hub.docker.com/r/azul/zulu-openjdk /usr/lib/jvm/zulu-7-amd64 /bin/bash "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-alpine:7 https://hub.docker.com/r/azul/zulu-openjdk-alpine /usr/lib/jvm/zulu7.25.0.5-jdk7.0.201-linux_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
azul/zulu-openjdk-debian:7 https://hub.docker.com/r/azul/zulu-openjdk-debian /usr/lib/jvm/zulu-7-amd64 bash
mcr.microsoft.com/java/jre-headless:11u2-zulu-alpine https://hub.docker.com/_/microsoft-java-jre-headless /usr/lib/jvm/zulu-11-azure-jre-headless_11.29.3-11.0.2-linux_musl_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
mcr.microsoft.com/java/jre-headless:8u192-zulu-alpine https://hub.docker.com/_/microsoft-java-jre-headless /usr/lib/jvm/zulu-8-azure-jre-headless_8.33.0.1-8.0.192-linux_musl_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
mcr.microsoft.com/java/jre-headless:7u201-zulu-alpine https://hub.docker.com/_/microsoft-java-jre-headless /usr/lib/jvm/zulu-7-azure-jre-headless_7.25.0.5-7.0.201-linux_x64 /bin/sh "LANG=en_US.UTF-8" "LANGUAGE=en_US:en" "LC_ALL=en_US.UTF-8"
amazoncorretto:8 https://hub.docker.com/_/amazoncorretto /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64 /bin/bash
fabric8/java-centos-openjdk8-jre https://hub.docker.com/r/fabric8/java-centos-openjdk8-jre /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64 /deployments/run-java.sh jboss "org.label-schema.build-date": "20181204" "org.label-schema.license": "GPLv2" "org.label-schema.name": "CentOS Base Image" "org.label-schema.schema-version": "1.0" "org.label-schema.vendor": "CentOS" "JAVA_APP_DIR=/deployments" "JAVA_MAJOR_VERSION=8" "JAVA_HOME=/etc/alternatives/jre"
fabric8/java-centos-openjdk7-jre https://hub.docker.com/r/fabric8/java-centos-openjdk7-jre /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.201-2.6.16.1.el7_6.x86_64 /deployments/run-java.sh jboss "org.label-schema.build-date": "20181204" "org.label-schema.license": "GPLv2" "org.label-schema.name": "CentOS Base Image" "org.label-schema.schema-version": "1.0" "org.label-schema.vendor": "CentOS" "JAVA_APP_DIR=/deployments" "JAVA_MAJOR_VERSION=7" "JAVA_HOME=/etc/alternatives/jre"
fabric8/java-alpine-openjdk8-jre https://hub.docker.com/r/fabric8/java-alpine-openjdk8-jre /usr/lib/jvm/java-1.8-openjdk /deployments/run-java.sh root "JAVA_APP_DIR=/deployments" "JAVA_MAJOR_VERSION=8"
fabric8/java-alpine-openjdk7-jre https://hub.docker.com/r/fabric8/java-alpine-openjdk7-jre /usr/lib/jvm/java-1.7-openjdk /deployments/run-java.sh root "JAVA_APP_DIR=/deployments" "JAVA_MAJOR_VERSION=7"
python:3 python3 "LANG=C.UTF-8" "GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D" "PYTHON_VERSION=3.7.2" "PYTHON_PIP_VERSION=19.0.1"
python:2 python2 "LANG=C.UTF-8" "PYTHONIOENCODING=UTF-8" "GPG_KEY=C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF" "PYTHON_VERSION=2.7.15" "PYTHON_PIP_VERSION=19.0.1"
node:11 node "NODE_VERSION=11.9.0" "YARN_VERSION=1.13.0"
node:10 node "NODE_VERSION=10.15.1" "YARN_VERSION=1.13.0"
node:8 node "NODE_VERSION=8.15.0" "YARN_VERSION=1.12.3"
node:6 node "NODE_VERSION=6.16.0" "YARN_VERSION=1.12.3"
php:7 docker-php-entrypoint php, -a "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c" "PHP_INI_DIR=/usr/local/etc/php" "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2" "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2" "PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie" "GPG_KEYS=CBAF69F173A0FEA4B537F470D66C9593118BCCB6 F38252826ACD957EF380D39F2F7956BC5DA04B5D" "PHP_VERSION=7.3.1" "PHP_URL=https://secure.php.net/get/php-7.3.1.tar.xz/from/this/mirror" "PHP_ASC_URL=https://secure.php.net/get/php-7.3.1.tar.xz.asc/from/this/mirror" "PHP_SHA256=cfe93e40be0350cd53c4a579f52fe5d8faf9c6db047f650a4566a2276bf33362" "PHP_MD5="
php:5 docker-php-entrypoint php, -a "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c" "PHP_INI_DIR=/usr/local/etc/php" "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2" "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2" "PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie" "GPG_KEYS=0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3" "PHP_VERSION=5.6.40" "PHP_URL=https://secure.php.net/get/php-5.6.40.tar.xz/from/this/mirror" "PHP_ASC_URL=https://secure.php.net/get/php-5.6.40.tar.xz.asc/from/this/mirror" "PHP_SHA256=1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c" "PHP_MD5="
mono:5 bash "MONO_VERSION=5.18.0.225"
microsoft/dotnet:2.2-runtime bash "ASPNETCORE_URLS=http://+:80" "DOTNET_RUNNING_IN_CONTAINER=true" "DOTNET_VERSION=2.2.1"
ruby:2 irb "RUBY_MAJOR=2.6" "RUBY_VERSION=2.6.0" "RUBY_DOWNLOAD_SHA256=acb00f04374899ba8ee74bbbcb9b35c5c6b1fd229f1876554ee76f0f1710ff5f" "GEM_HOME=/usr/local/bundle" "BUNDLE_PATH=/usr/local/bundle" "BUNDLE_SILENCE_ROOT_WARNING=1" "BUNDLE_APP_CONFIG=/usr/local/bundle"

@briandealwis
Copy link
Member

#291 adds a JAVA_VERSION environment variable to the built images. I intended to add the jdk.vendor and jdk.version labels as requested here but both Docker and OCI recommend namespacing labels/annotations using reverse-DNS prefixes.

It's easy to add labels to a container_image definition:

+    labels = {
+         "jdk.version": jre_ver(versions[jre_deb]),
+         "jdk.vendor": "openjdk",
+         "jdk.source": jre_deb + " " + versions[jre_deb],
+     },

@briandealwis
Copy link
Member

Oops, meant to mention that JAVA_VERSION is of the form:

  • 8u181: on distroless/java:8
  • 11.0.1: on distroless/java:11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants