Answer the question
In order to leave comments, you need to log in
How to install java in docker?
Hello.
To minify js and css files, I added java to the image:
FROM webdevops/php-apache-dev:7.3
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils software-properties-common
# Install OpenJDK-8
RUN apt-get update && \
mkdir -p /usr/share/man/man1 && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
Answer the question
In order to leave comments, you need to log in
Issue which you resulted is connected with the license. Your problem is no. There is an error because of the oracle package, you are trying to install openjdk.
Find out why the package is not available. Maybe the name has changed, maybe something else ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question