fabric8io-images / java

Java Base Images
Apache License 2.0
176 stars 99 forks source link

[36] create CentOS based OpenJDK 11 images #37

Closed drwoods closed 5 years ago

drwoods commented 5 years ago

PR for https://github.com/fabric8io-images/java/issues/36 Since there are no official GA/supported binaries of OpenJDK available for Alpine, this PR only adds images for CentOS. Also, since the JBoss images are deprecated (in the images.yml file) there was attempt to create those images.

I built the Docker images locally and verified that the expected Java levels were installed -

For centos/openjdk11/jdk/Dockerfile -

> docker build .
. . .
Step 15/15 : CMD [ "/deployments/run-java.sh" ]
 ---> Running in 27b8b2a01df5
Removing intermediate container 27b8b2a01df5
 ---> a32bd7fa6635
Successfully built a32bd7fa6635
> docker run -it --rm a32bd7fa6635 java -version
openjdk version "11.0.2" 2019-01-15 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.2+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7-LTS, mixed mode, sharing)

For centos/openjdk11/jre/Dockerfile -

> docker build .
. . .
Step 15/15 : CMD [ "/deployments/run-java.sh" ]
 ---> Running in 7565e5cff37d
Removing intermediate container 7565e5cff37d
 ---> ccf3aa3449ef
Successfully built ccf3aa3449ef
> docker run -it --rm ccf3aa3449ef java -version
openjdk version "11.0.2" 2019-01-15 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.2+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7-LTS, mixed mode, sharing)
rhuss commented 5 years ago

@drwoods Can you please verify whether java-11.0.2-openjdk-11.0.2.7-0.el7_6 and java-11.0.2-openjdk-devel-11.0.2.7-0.el7_6 really exist ?

When I do a Docker build on the generated files (e.g. in images/centos/openjdk11/jdk) then I get the following error:

Sending build context to Docker daemon  66.56kB
Step 1/20 : FROM centos:7.6.1810
 ---> f1cb7c7d58b7
Step 2/20 : USER root
 ---> Using cache
 ---> 74479d015623
Step 3/20 : RUN mkdir -p /deployments
 ---> Using cache
 ---> 726fb3103ec0
Step 4/20 : ENV JAVA_APP_DIR=/deployments     JAVA_MAJOR_VERSION=11
 ---> Using cache
 ---> 5733e181c481
Step 5/20 : RUN yum install -y        java-11.0.2-openjdk-11.0.2.7-0.el7_6        java-11.0.2-openjdk-devel-11.0.2.7-0.el7_6     && echo "securerandom.source=file:/dev/urandom" >> /usr/lib/jvm/java/jre/lib/security/java.security     && yum clean all
 ---> Running in 34daf4354ced
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: ftp.antilo.de
 * extras: mirror.imt-systems.com
 * updates: mirror.23media.com
No package java-11.0.2-openjdk-11.0.2.7-0.el7_6 available.
No package java-11.0.2-openjdk-devel-11.0.2.7-0.el7_6 available.
Error: Nothing to do
The command '/bin/sh -c yum install -y        java-11.0.2-openjdk-11.0.2.7-0.el7_6        java-11.0.2-openjdk-devel-11.0.2.7-0.el7_6     && echo "securerandom.source=file:/dev/urandom" >> /usr/lib/jvm/java/jre/lib/security/java.security     && yum clean all' returned a non-zero code: 1
rhuss commented 5 years ago

No worries, fixed with #42

drwoods commented 5 years ago

Roland, thanks for cleaning it up!