I want to install java8 in Ubuntu image on docker. so I inserted follow codes in dockerfile:
FROM ubuntu:latest
RUN apt-get update
CMD ["echo", "apt-get update done ..."]
RUN apt-get -qq install -y wget
CMD ["echo", "wget Done ..."]
RUN apt-get install -y software-properties-common
CMD ["echo","apt-get install -y software-properties-common"]
RUN add-apt-repository -y ppa:webupd8team/java
CMD ["echo","add-apt-repository. ..."]
RUN apt-get update
RUN apt-get -qq upgrade
CMD ["echo", "apt-get update done ..."]
# add webupd8 repository
RUN \
wget https://download.docker.com/linux/ubuntu/gpg && \
apt-key add gpg &&\
apt-get update &&\
echo "===> add webupd8 repository..." && \
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
apt-get update
RUN echo "===> install Java" && \
apt-get -qq upgrade && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
apt-get update &&\
DEBIAN_FRONTEND=noninteractive apt-get install -f oracle-java8-installer
but give me this error ```Reading package lists... Building dependency tree... Reading state information... Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'oracle-java8-installer' has no installation candidate ```
there is an image in Docker Hub that Ubuntu+java8. so can use this repository ( enter link description here )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.