在Dockerfile

时间:2018-01-19 00:52:51

标签: java ubuntu docker java-8 dockerfile

我有一个Docker容器,我在其中安装Java / JDK以便为Pentaho供电。从最近的~9天开始(我相信),我在尝试构建这个容器时遇到了错误。

我不确定特定的jdk是否已被oracle存档,但是我花了一整天的时间试图找到解决这个问题的方法并达到死胡同。

寻找一个PPA或积极的dist来让我摆脱这个烂摊子。

来自Dockerfile:

# Pentaho
ENV PDI_RELEASE=6.1 \
    PDI_VERSION=6.1.0.1-196 \
    PDI_HOME=/opt/pentaho-di \
    KETTLE_HOME=/pentaho-di

# Java
# auto validate license
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
    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 && \
    apt-get -y install oracle-java8-installer unzip && \
    apt-get clean && \
    curl -sS -L -o /tmp/pdi-ce-${PDI_VERSION}.zip http://downloads.sourceforge.net/project/pentaho/Data%20Integration/${PDI_RELEASE}/pdi-ce-${PDI_VERSION}.zip && \
    unzip -q /tmp/pdi-ce-${PDI_VERSION}.zip -d $PDI_HOME && \
    rm /tmp/pdi-ce-${PDI_VERSION}.zip

这是我从构建中获得的失败:

2018-01-18T17:59:31.674ZUnpacking locales (2.19-18+deb8u10) ...
2018-01-18T17:59:32.569ZSelecting previously unselected package oracle-java8-installer.
2018-01-18T17:59:32.571ZPreparing to unpack .../oracle-java8-installer_8u151-1~webupd8~0_all.deb ...
2018-01-18T17:59:32.742Zdebconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
2018-01-18T17:59:32.966Zoracle-license-v1-1 license has already been accepted
2018-01-18T17:59:32.983ZUnpacking oracle-java8-installer (8u151-1~webupd8~0) ...
2018-01-18T17:59:33.245ZProcessing triggers for mime-support (3.58) ...
2018-01-18T17:59:33.636ZProcessing triggers for hicolor-icon-theme (0.13-1) ...
2018-01-18T17:59:33.644ZProcessing triggers for shared-mime-info (1.3-1) ...
2018-01-18T17:59:36.221ZSetting up java-common (0.52) ...
2018-01-18T17:59:36.333ZSetting up locales (2.19-18+deb8u10) ...
2018-01-18T17:59:36.421Zdebconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
2018-01-18T17:59:36.839ZGenerating locales (this might take a while)...
2018-01-18T17:59:36.842ZGeneration complete.
2018-01-18T17:59:36.877ZSetting up oracle-java8-installer (8u151-1~webupd8~0) ...
2018-01-18T17:59:36.969Zdebconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
2018-01-18T17:59:37.411ZNo /var/cache/oracle-jdk8-installer/wgetrc file found.
Creating /var/cache/oracle-jdk8-installer/wgetrc and
using default oracle-java8-installer wgetrc settings for it.
Downloading Oracle Java 8...
2018-01-18T17:59:38.406Z--2018-01-18 17:59:38--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 
2018-01-18T17:59:38.488Z184.84.129.202
Connecting to download.oracle.com (download.oracle.com)|184.84.129.202|:80... 
2018-01-18T17:59:38.488Zconnected.
HTTP request sent, awaiting response... 
2018-01-18T17:59:38.490Z302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz [following]
--2018-01-18 17:59:38--  https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
2018-01-18T17:59:38.501ZResolving edelivery.oracle.com (edelivery.oracle.com)... 
2018-01-18T17:59:38.635Z23.212.176.23, 2600:1408:10:397::2d3e, 2600:1408:10:3b5::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.212.176.23|:443... 
2018-01-18T17:59:38.636Zconnected.
2018-01-18T17:59:38.644ZHTTP request sent, awaiting response... 
2018-01-18T17:59:38.738Z302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516298498_6fba300d1f634adc9f84ee54d5966fce [following]
--2018-01-18 17:59:38--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516298498_6fba300d1f634adc9f84ee54d5966fce
2018-01-18T17:59:38.738ZConnecting to download.oracle.com (download.oracle.com)|184.84.129.202|:80... 
2018-01-18T17:59:38.739Zconnected.
2018-01-18T17:59:38.739ZHTTP request sent, awaiting response... 
2018-01-18T17:59:38.758Z404 Not Found
2018-01-18 17:59:38 ERROR 404: Not Found.

2018-01-18T17:59:38.808Zdownload failed
Oracle JDK 8 is NOT installed.

我已经尝试过SO和互联网'指导:

RUN apt-get -y install software-properties-common python-software-properties && \
    add-apt-repository ppa:webupd8team/java && \
    apt-get update
RUN cd /var/lib/dpkg/info && \
    sed -i 's|JAVA_VERSION=8u151|JAVA_VERSION=8u161|' oracle-java8-installer.* && \
    sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/|' oracle-java8-installer.* && \
    sed -i 's|SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f"|SHA256SUM_TGZ="6dbc56a0e3310b69e91bb64db63a485bd7b6a8083f08e48047276380a0e2021e"|' oracle-java8-installer.* && \
    sed -i 's|J_DIR=jdk1.8.0_151|J_DIR=jdk1.8.0_161|' oracle-java8-installer.*
RUN apt-get -y install oracle-java8-installer unzip

不幸的是,看起来jessie dist缺失了 - 这就是错误:

(image: pre-deps) (service: rails_pre_deps) OK
(image: pre-deps) (service: rails_pre_deps) Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
(image: pre-deps) (service: rails_pre_deps) Ign http://ppa.launchpad.net jessie InRelease
(image: pre-deps) (service: rails_pre_deps) Hit http://ppa.launchpad.net trusty InRelease
(image: pre-deps) (service: rails_pre_deps) Ign http://deb.debian.org jessie InRelease
(image: pre-deps) (service: rails_pre_deps) Hit http://deb.debian.org jessie-updates InRelease
(image: pre-deps) (service: rails_pre_deps) Hit http://deb.debian.org jessie Release.gpg
(image: pre-deps) (service: rails_pre_deps) Ign http://ppa.launchpad.net jessie Release.gpg
(image: pre-deps) (service: rails_pre_deps) Hit http://deb.debian.org jessie Release
(image: pre-deps) (service: rails_pre_deps) Ign http://ppa.launchpad.net jessie Release
(image: pre-deps) (service: rails_pre_deps) Err http://ppa.launchpad.net jessie/main amd64 Packages
(image: pre-deps) (service: rails_pre_deps)
(image: pre-deps) (service: rails_pre_deps) Err http://ppa.launchpad.net jessie/main amd64 Packages
(image: pre-deps) (service: rails_pre_deps)
(image: pre-deps) (service: rails_pre_deps) Err http://ppa.launchpad.net jessie/main amd64 Packages
(image: pre-deps) (service: rails_pre_deps)
(image: pre-deps) (service: rails_pre_deps) Err http://ppa.launchpad.net jessie/main amd64 Packages
(image: pre-deps) (service: rails_pre_deps)
(image: pre-deps) (service: rails_pre_deps) Err http://ppa.launchpad.net jessie/main amd64 Packages
(image: pre-deps) (service: rails_pre_deps)   404  Not Found

对产出差异表示歉意。一个来自jet,另一个来自代码。

感谢您的帮助

0 个答案:

没有答案