docker java7安装失败 [英] docker java7 install fail

查看:333
本文介绍了docker java7安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过ppa(RUN add-apt-repository ppa:webupd8team / java -y)在我的docker映像中安装java7,但是失败了这个错误:

I'm trying to install java7 via ppa (RUN add-apt-repository ppa:webupd8team/java -y) in my docker image but it fails with this error:

returned a non-zero code: 127

以下是建议正确安装的方法,但它不工作。我也尝试过这两个ppas。

The following are suggested ways to install correctly but it's not working. I've tried both ppas as well.

RUN  apt-get install python-software-properties -y
RUN  add-apt-repository ppa:webupd8team/java -y
#RUN add-apt-repository ppa:eugenesan/java -y
RUN apt-get update
RUN  apt-get install oracle-java7-installer -y

这是日志输出:

Step 28 : RUN  add-apt-repository ppa:webupd8team/java -y
 ---> Running in b278761a4209
 [91m/bin/sh: 1: add-apt-repository: not found
 [0m 

所以...我需要找出哪里/如果这个命令存在于一个帮助程序库或什么:

So...I need to find out where/if this command exist in a helper lib or what:

add-apt-repository

add-apt-repository似乎是python-software-properties安装。除了在构建的其他区域中弹出的这些消息之外,我没有看到任何真正的错误。所以我假设,如果我可以解决这个问题,上述python步骤将根据需要进行安装:

add-apt-repository appears to be a part of the python-software-properties install. I don't see any real errors in that step except for these messages which pop up in other areas of the build. So I assume that if I can resolve this issue the aforementioned python step will install as needed:

    [91mdebconf: unable to initialize frontend: Dialog
     debconf: (TERM is not set, so the dialog frontend is not usable.)
     debconf: falling back to frontend: Readline
     [0m[91mdebconf: unable to initialize frontend: Readline
     debconf: (This frontend requires a controlling tty.)
     debconf: falling back to frontend: Teletype
     [0m[91mdpkg-preconfigure: unable to re-open stdin: 

所以。如何设置术语或对话框?我以为 - 你允许这个

So. How to set a term or dialog up? I thought the -y allowed this

推荐答案

你的 -y apt-get install 命令告诉 apt-get 以假设是,这与运行不一样在非交互模式下。

The -y in your apt-get install commands is telling apt-get to "assume yes", which isn't the same as running in non-interactive mode.

您正在看到无法初始化前端:对话框消息,因为Debian正在运行 apt-get 在交互模式。要告诉它以非交互模式运行,请将此行添加到Dockerfile的开头:

You're seeing the "unable to initialize frontend: Dialog" messages because Debian is running apt-get in interactive mode. To tell it to run in non-interactive mode, add this line to the start of your Dockerfile:

ENV DEBIAN_FRONTEND noninteractive

现在您的命令将以非交互模式运行,因此 apt-get 不会尝试弹出任何对话框。

Now your commands will be running in non-interactive mode, so apt-get won't try and pop any dialogs up.

对于您的实际错误,您是对的, add- apt-respository python-software-properties 的一部分。尝试将 apt-get update -y 命令放在您的 apt-get install python-software-properties 命令之上。

As for your actual error, you're right, add-apt-respository is a part of the python-software-properties. Try putting your apt-get update -y command above your apt-get install python-software-properties command.

RUN apt-get update -y                             && \
    apt-get install python-software-properties -y && \
    add-apt-repository ppa:webupd8team/java -y    && \
    apt-get update -y                             && \
    apt-get install oracle-java7-installer -y     && \
    oracle-java7-set-default

注意,你需要做两个 apt-get update -y 命令,一个在你开始之前(总是一个好习惯),之后你添加了oracle java PPA。

Note, you'll need to do two apt-get update -y commands, one before you start (always a good habit to get into) and one after you've added the oracle java PPA.

apt-get manual

Docker ENV文档

这篇关于docker java7安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆