我正在尝试在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)
谢谢你, 尔汉
答案 0 :(得分:2)
截至今天上午,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