Docker:在Ubuntu上安装Java 8失败

我正在尝试在Docker容器中安装Ubuntu的基本映像的Java 8。 我正在运行以下命令,

RUN apt-get update && \ apt-get install -y software-properties-common python-software-properties && \ add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" && \ apt-get update && \ echo "$accept-license" | sudo debconf-set-selections && \ apt-get install --allow-unauthenticated -y oracle-java8-installer && \ rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/oracle-jdk8-installer 

在运行上面的命令我收到以下错误,

 Connecting to download.oracle.com (download.oracle.com)|23.57.66.26|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2017-10-20 06:29:41 ERROR 404: Not Found. 

下载失败

 Oracle JDK 8 is NOT installed. dpkg: error processing package oracle-java8-installer (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: oracle-java8-installer E: Sub-process /usr/bin/dpkg returned an error code (1) 

谢谢你,Farhan

截至今天上午,Webupd8 Oracle-java8-installer已成功下载并安装在Docker中。 PPA安装程序中的链接必须已更新。 好极了!

我的Dockerfile在上周末失败,但现在工作

 FROM ubuntu:14.04 USER root RUN apt-get update RUN apt-get -y install default-jre RUN apt-get install -y software-properties-common python-software-properties RUN apt-get -y -q update && \ apt-get -y -q upgrade && \ apt-get -y -q install software-properties-common htop && \ add-apt-repository ppa:webupd8team/java && \ apt-get -y -q update && \ echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \ apt-get -y -q install oracle-java8-installer && \ update-java-alternatives -s java-8-oracle 

这是因为您使用的存储库可能不存在。 尝试另一个回购。