Como instalar Java em uma imagem Gentoo Docker

Como instalar Java em uma imagem Gentoo Docker

Eu tenho uma imagem do Gentoo Docker. Estou tentando instalar o Java 8 dentro do contêiner. Existem tutoriais na web, mas eles não ajudaram.

Eu tentei executar:

emerge  --verbose dev-java/icedtea-bin:8

Mas obtive esta saída:

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by net-print/cups-filters-1.21.6::gentoo[postscript]
# required by net-print/cups-2.2.7::gentoo
# required by dev-java/icedtea-bin-3.10.0-r1::gentoo[cups,-multilib]
# required by virtual/jdk-1.8.0-r3::gentoo
# required by virtual/jre-1.8.0-r1::gentoo
# required by dev-java/icedtea-web-1.6.2::gentoo
>=app-text/ghostscript-gpl-9.26 cups

Use --autounmask-write to write changes to config files (honoring
CONFIG_PROTECT). Carefully examine the list of proposed changes,
paying special attention to mask or keyword changes that may expose
experimental or unstable packages.

Responder1

Poderia instalá-lo baixando o arquivo tar.gz, assim:

...
RUN wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz \
 && mkdir /opt/jdk \
 && tar zxf jdk-8u131-linux-x64.tar.gz -C /opt/jdk \
 && update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_131/bin/java 100 \
 && update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_131/bin/javac 100 \
 && update-alternatives --display java \
 && update-alternatives --display javac \
 && rm -rf jdk-8u131-linux-x64.tar.gz
...

Responder2

EXECUTAR wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie"http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz EXECUTAR mkdir /opt/jdk EXECUTAR tar zxf jdk-8u131-linux-x64.tar.gz -C /opt/jdk ENV PATH=$PATH:/opt/jdk/jdk1.8.0_131/bin

informação relacionada