I am trying to make a Dockerfile where Java11 has to be "loaded".
However, when I try:
RUN add-apt-repository -y ppa:linuxuprising/java
then I get this error:
/bin/sh: 1: add-apt-repository: not found The command '/bin/sh -c add-apt-repository -y ppa:linuxuprising/java' returned a non-zero code: 127
My question is how could I "install" Java11 on Docker?
Assuming that is not possible to base your image on a OpenJDK official image.
Take a look to how it is installed in the official image Dockerfile (or the repository).
There are also alternatives images, like AdoptOpenJDK (Dockerfile based on Ubuntu)
For CentOS in your docker image you still can use:
FROM centos
RUN yum install -y java-11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With