openjdk-8-jre-headless : Breaks: ca-certificates-java (< 20160321~) - java

Below command:
FROM microsoft/aspnetcore-build:1.0.1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
# This is FROM openjdk:8-jdk
RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils \
apt-transport-https \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get install -y --no-install-recommends apt-transport-https ca-certificates
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys AA8E81B4331F7F50
# RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list
RUN echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/100disablechecks
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# ENV JAVA_VERSION 8u111
# ENV JAVA_DEBIAN_VERSION 8u111-b14-2~bpo8+1
ENV JAVA_VERSION 8u171
ENV JAVA_DEBIAN_VERSION 8u171-b11-1~bpo8+1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
ENV CA_CERTIFICATES_JAVA_VERSION 20140324
# RUN set -x \
# && apt-get update \
# && apt-get install -y \
# openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
# ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
# && rm -rf /var/lib/apt/lists/* \
# && [ "$JAVA_HOME" = "$(docker-java-home)" ]
RUN set -x \
&& apt-get update \
&& apt-get install -y openjdk-8-jre-headless ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& apt-get install -y openjdk-8-jre-headless \
openjdk-8-jdk-headless \
openjdk-8-jre \
openjdk-8-jdk \
# ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
##### END OF THE JDK
##### START Jenkins Slave Node Config settings
# Create Jenkins User
RUN useradd jenkins -m -s /bin/bash
RUN chown -R jenkins /home/jenkins
RUN chgrp -R jenkins /home/jenkins
RUN chown -R jenkins /tmp
RUN chgrp -R jenkins /tmp
# Add the jenkins user to sudoers
RUN echo "jenkins ALL=(ALL) ALL" >> etc/sudoers
# Must install docker to create docker images from docker container. Inception. Head... hurts.
# container must be called with -v /var/run/docker.sock:/var/run/docker.sock
RUN apt-get update && apt-get install -y --no-install-recommends \
docker-engine \
&& rm -rf /var/lib/apt/lists/*
# This must run after the docker install
RUN gpasswd -a jenkins docker
USER jenkins
gives error:
Step 16/26 : RUN set -x && apt-get update && apt-get install -y openjdk-8-jre-headless ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && apt-get install -y openjdk-8-jre-headless openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jdk && rm -rf /var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]
---> Running in 3733400f9098
+ apt-get update
Get:1 https://apt.dockerproject.org debian-jessie InRelease [48.7 kB]
Get:2 http://archive.debian.org jessie-backports InRelease [166 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [16.3 kB]
Get:4 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:5 http://deb.debian.org jessie Release.gpg [1652 B]
Get:6 http://deb.debian.org jessie Release [77.3 kB]
Get:7 https://apt.dockerproject.org debian-jessie/main amd64 Packages [7366 B]
Get:8 http://archive.debian.org jessie-backports/main amd64 Packages [1171 kB]
Get:9 http://deb.debian.org jessie-updates/main amd64 Packages [20 B]
Get:10 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Get:11 http://security.debian.org jessie/updates/main amd64 Packages [892 kB]
Fetched 11.5 MB in 14s (818 kB/s)
Reading package lists...
+ apt-get install -y openjdk-8-jre-headless ca-certificates-java=20140324
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openjdk-8-jre-headless : Breaks: ca-certificates-java (< 20160321~) but 20140324 is to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'slavedotnet' failed to build: The command '/bin/sh -c set -x && apt-get update && apt-get install -y openjdk-8-jre-headless ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && apt-get install -y openjdk-8-jre-headless openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jdk && rm -rf /var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]' returned a non-zero code: 100
How to resolve the certificate dependency?

Related

dockerfile - openjdk-8-jdk have unmet dependencies

In continuation to question, below is the updated docker file:
FROM microsoft/aspnetcore-build:1.0.1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
# This is FROM openjdk:8-jdk
RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils \
apt-transport-https \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get install -y --no-install-recommends apt-transport-https ca-certificates
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys AA8E81B4331F7F50
# RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list
RUN echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/100disablechecks
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# ENV JAVA_VERSION 8u111
# ENV JAVA_DEBIAN_VERSION 8u111-b14-2~bpo8+1
# ENV JAVA_VERSION 8u222
# ENV JAVA_DEBIAN_VERSION 8u222-b10-1ubuntu1~18.04.1
ENV JAVA_VERSION 8u171
ENV JAVA_DEBIAN_VERSION 8u171-b11-1~bpo8+1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
ENV CA_CERTIFICATES_JAVA_VERSION 20140324
RUN set -x \
&& apt-get update \
&& apt-get install -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
##### END OF THE JDK
##### START Jenkins Slave Node Config settings
# Create Jenkins User
RUN useradd jenkins -m -s /bin/bash
RUN chown -R jenkins /home/jenkins
RUN chgrp -R jenkins /home/jenkins
RUN chown -R jenkins /tmp
RUN chgrp -R jenkins /tmp
# Add the jenkins user to sudoers
RUN echo "jenkins ALL=(ALL) ALL" >> etc/sudoers
# Must install docker to create docker images from docker container. Inception. Head... hurts.
# container must be called with -v /var/run/docker.sock:/var/run/docker.sock
RUN apt-get update && apt-get install -y --no-install-recommends \
docker-engine \
&& rm -rf /var/lib/apt/lists/*
# This must run after the docker install
RUN gpasswd -a jenkins docker
USER jenkins
Below is the error:
Step 16/26 : RUN set -x && apt-get update && apt-get install -y openjdk-8-jdk="$JAVA_DEBIAN_VERSION" ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && rm -rf /var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]
---> Running in 6d823a145982
+ apt-get update
Get:1 https://apt.dockerproject.org debian-jessie InRelease [48.7 kB]
Get:2 http://archive.debian.org jessie-backports InRelease [166 kB]
Get:3 https://apt.dockerproject.org debian-jessie/main amd64 Packages [7366 B]
Get:4 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:5 http://deb.debian.org jessie-updates InRelease [16.3 kB]
Get:6 http://archive.debian.org jessie-backports/main amd64 Packages [1171 kB]
Get:7 http://deb.debian.org jessie Release.gpg [1652 B]
Get:8 http://deb.debian.org jessie Release [77.3 kB]
Get:9 http://security.debian.org jessie/updates/main amd64 Packages [892 kB]
Get:10 http://deb.debian.org jessie-updates/main amd64 Packages [20 B]
Get:11 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 11.5 MB in 14s (803 kB/s)
Reading package lists...
+ apt-get install -y openjdk-8-jdk=8u171-b11-1~bpo8+1 ca-certificates-java=20140324
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openjdk-8-jdk : Depends: openjdk-8-jre (= 8u171-b11-1~bpo8+1) but it is not going to be installed
Depends: openjdk-8-jdk-headless (= 8u171-b11-1~bpo8+1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'slavedotnet' failed to build: The command '/bin/sh -c set -x && apt-get update && apt-get install -y openjdk-8-jdk="$JAVA_DEBIAN_VERSION" ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && rm -rf /var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]' returned a non-zero code: 100
How to resolve this version issue?
See this:
The backports repository is deactivated by default. So, if you want to install a backported package, you will have to state that explicitly.
For example:
debian:/home/human# aptitude -t buster-backports install cockpit
So, for your case, you need to change to next:
apt-get install -t jessie-backports -y \
openjdk-8-jdk \
ca-certificates-java \
Here, I suggest you don't add version selection for package like next:
openjdk-8-jdk="$JAVA_DEBIAN_VERSION"
Because, default it will choose the latest version in this os release apt repo. If you insist, then for backports repo, you need to separate install them:
apt-get install -t jessie-backports -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" && \
apt-get install -t jessie-backports -y \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \

Oracle java 8 unable to find package

This is my dockerfile:
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt install -y locales curl software-properties-common gnupg && \
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list && \
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && apt-get update && apt-get install -y curl dnsutils oracle-java8-installer ca-certificates && \
locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8
When I try to build the image with this command: docker build -t javaimage -f java.Dockerfile ., I get the following error:
E: Unable to locate package oracle-java8-installer
The command '/bin/sh -c apt-get update && apt install -y locales curl software-properties-common gnupg && echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list && echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list && echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && apt-get update && apt-get install -y curl dnsutils oracle-java8-installer ca-certificates && locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8' returned a non-zero code: 100
roger#NB-SBDEV1149:~/Projet
Does anyone know how do I solve this? Using openjdk is not an option.
Thanks to Oracles new License for Java, that PPA is no longer valid.
Check here: https://launchpad.net/~webupd8team/+archive/ubuntu/java
The new Oracle Technology Network License Agreement for Oracle Java SE
is substantially different from prior Oracle JDK licenses. The new
license permits certain uses, such as personal use and development
use, at no cost -- but other uses authorized under prior Oracle JDK
licenses may no longer be available. Please review the terms carefully
before downloading and using this product. An FAQ is available here:
https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html
Oracle Java downloads now require logging in to an Oracle account to
download Java updates, like the latest Oracle Java 8u211 / Java SE
8u212. Because of this I cannot update the PPA with the latest Java
(and the old links were broken by Oracle).
For this reason, THIS PPA IS DISCONTINUED (unless I find some way
around this limitation).
If you want, you can use openjdk by doing apt-get install openjdk-8-jre instead

Setting Up DB2 in Airflow

I am trying to connect DB2 as a data connection for airflow which is residing in a Docker Container (realizing that this is not nativly supported). I am developing on a Mac
I have added the connectionas seen in the below screenshot where the URL is host:port/databse.
I am then going to the Data Profiling > Ad Hoc Query to try and test the connection and I get the below.
In order to make sure the drivers were available, I mounted the folder where the jdbc driver is located to /usr/local/airflow/drivers in the docker-compose file.
I also made sure to include the below packages in my requirements.txt as these were required when I query from a jupyter notebook.
sasl
thrift_sasl
jaydebeapi
jpype1
ibm_db
ibm_db_sa
I can't figure out what I'm missing.
I've been through:
Airflow documentation
Unable to setup a DB2 / DashDB JDBC Connection in Apache Airflow
Apache Airflow db2 Connection
Apache Airflow db2 Connection
https://github.com/puckel/docker-airflow
Lots of GitHub issues
and many more resources but can't find anything that solves this
Here is my current Dockerfile. As indicated in the comments, JVM isn't installed in the Dockerfile so that may be the issue.
# VERSION 1.10.1
# AUTHOR: Matthieu "Puckel_" Roisil
# DESCRIPTION: Basic Airflow container
# BUILD: docker build --rm -t puckel/docker-airflow .
# SOURCE: https://github.com/puckel/docker-airflow
FROM python:3.6-slim
LABEL maintainer="Puckel_"
# Never prompts the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
# Airflow
ARG AIRFLOW_VERSION=1.10.1
ARG AIRFLOW_HOME=/usr/local/airflow
ARG AIRFLOW_DEPS=""
ARG PYTHON_DEPS=""
ENV AIRFLOW_GPL_UNIDECODE yes
# Define en_US.
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_MESSAGES en_US.UTF-8
# Java
RUN apt-get update && apt-get install -y openjdk-7-jre-headless wget \
&& apt-get clean
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
RUN set -ex \
&& buildDeps=' \
freetds-dev \
libkrb5-dev \
libsasl2-dev \
libssl-dev \
libffi-dev \
libpq-dev \
git \
' \
&& apt-get update -yqq \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends \
$buildDeps \
freetds-bin \
build-essential \
default-libmysqlclient-dev \
apt-utils \
curl \
rsync \
netcat \
locales \
&& sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
&& useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow \
&& pip install -U pip setuptools wheel \
&& pip install pytz \
&& pip install pyOpenSSL \
&& pip install ndg-httpsclient \
&& pip install pyasn1 \
&& pip install apache-airflow[crypto,celery,postgres,hive,jdbc,mysql,ssh${AIRFLOW_DEPS:+,}${AIRFLOW_DEPS}]==${AIRFLOW_VERSION} \
&& pip install 'redis>=2.10.5,<3' \
&& if [ -n "${PYTHON_DEPS}" ]; then pip install ${PYTHON_DEPS}; fi \
&& apt-get purge --auto-remove -yqq $buildDeps \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
COPY script/entrypoint.sh /entrypoint.sh
COPY config/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
COPY requirements.txt ${AIRFLOW_HOME}/requirements.txt
RUN pip install --upgrade pip && pip install -r requirements.txt
RUN chown -R airflow: ${AIRFLOW_HOME}
EXPOSE 8080 5555 8793
USER airflow
WORKDIR ${AIRFLOW_HOME}
ENTRYPOINT ["/entrypoint.sh"]
CMD ["webserver"] # set default arg for entrypoint
The jpype1 module requires a JVM, accessible on your $PATH -- try installing one and try again.
Finally figured it out. Below is what I ended up using to get Java installed. then I just mounted the folder with my driver in it.
# Java
RUN mkdir -p /usr/share/man/man1 && \
(echo "deb http://http.debian.net/debian stretch main" > /etc/apt/sources.list.d/backports.list) && \
apt-get update -y \
&& apt-get install --no-install-recommends -y build-essential libkrb5-dev libsasl2-dev libffi-dev default-libmysqlclient-dev vim-tiny gosu krb5-user openjdk-8-jre openjdk-8-jdk-headless openjdk-8-jdk openjdk-8-jre-headless \
&& apt-get clean
RUN apt-get install unzip -y && \
apt-get autoremove -y

Installing java on Docker php:7.1-apache-stretch

Been slamming this docker config file for a few hours now and am starting to conclude this is impossible. Help me change my mind!
I'm trying to install open-jdk in a docker image like so:
FROM php:7.1-apache-stretch
# NOTE: We cannot upgrade to 7.2+ until we remove all uses of mcrypt. It
is officially removed.
RUN echo 'deb http://deb.debian.org/debian stretch-backports main' >
/etc/apt/sources.list.d/backports.list
RUN apt-get update
RUN apt-get install -y stretch-backports
RUN apt-get install -y default-jdk-headless ca-certificates-java
And get the following error:
E: Unable to locate package stretch-backports
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get
install -y stretch-backports' returned a non-zero code: 100
Success! I was able to resolve by following this:
https://assertnull.com/installing-java-in-docker-php/
Here's my dockerfile now:
FROM php:7.1-apache-stretch
# NOTE: We cannot upgrade to 7.2+ until we remove all uses of mcrypt. It is officially removed.
# Hack for debian-slim to make the jdk install work below.
RUN mkdir -p /usr/share/man/man1
# repo needed for jdk install below.
RUN echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list
# Update image & install application dependant packages.
RUN apt-get update && apt-get install -y \
nano \
libxext6 \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmcrypt-dev \
libxslt-dev \
libpcre3-dev \
libxrender1 \
libfontconfig \
uuid-dev \
ghostscript \
curl \
wget \
ca-certificates-java
RUN apt-get -t stretch-backports install -y default-jdk-headless

Docker and Java 9 modules

Are there Docker images for specific Java 9 modules?
I guess there should appear base images for FROM java:9, but how would optional modules come, if my base would be from minimal core Java 9 module.
Here is one example:
FROM java:9
COPY /target/myswarmproject-swarm.jar /home/myswarm-swarm.jar
EXPOSE 8080
CMD java -jar /home/myswarmproject-swarm.jar
Previous dockerfile example is for wildfly swarm project which is deployed as .jar into the container.
Here is my implementation, also found at adenix/java:9u181:
FROM ubuntu:16.04
RUN \
apt update && \
apt install -y curl && \
curl -jkL -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9+181/jdk-9_linux-x64_bin.tar.gz -o jdk-9_linux-x64_bin.tar.gz && \
apt remove -y curl && \
apt clean && \
apt -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
tar xvzf jdk-9_linux-x64_bin.tar.gz -C /opt/ && \
rm -rf jdk-9_linux-x64_bin.tar.gz && \
update-alternatives --install /usr/bin/java java /opt/jdk-9/bin/java 100 && \
update-alternatives --install /usr/bin/javac javac /opt/jdk-9/bin/javac 100 && \
update-alternatives --install /usr/bin/jshell jshell /opt/jdk-9/bin/jshell 100
CMD ["jshell"]
You could implement this by either duplicating this Docker file or using FROM adenix/java:9u181 in your Dockerfile.

Categories