使用下面的Dockerfile尝试在上安装Oracle JDK-1.8 xenial i386 image
。但是在docker build期间失败。
# Install oracle jdk 1.8
RUN add-apt-repository ppa:webupd8team/java && \
apt-get -y update
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
RUN apt-get -y install oracle-java8-installer && \
java -version
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
如果失败并出现以下错误。
E: Package 'oracle-java8-installer' has no installation candidate
The command '/bin/sh -c apt-get -y install oracle-java8-installer && java -version' returned a non-zero code: 100
已尝试过,add-apt-repository ppa:ts.sch.gr/ppa
显示以下错误。
'ascii' codec can't decode byte 0xce in position 71: ordinal not in range(128)
The command '/bin/sh -c add-apt-repository ppa:ts.sch.gr/ppa && apt-get -y update' returned a non-zero code: 1
我该如何安装Oracle JDK-1.8 on Ubuntu-16.04LTS (xenial i386)
?
答案1
在Dockerfile中添加ENV LANG C.UTF-8
并能够安装Java。