我想通过ppa(运行 add-apt-repository ppa:webupd8team/java -y)在我的Docker镜像中安装Java7,但是出现了以下错误:
returned a non-zero code: 127
以下是安装正确但无法正常工作的建议方法,我已经尝试了两个ppa源。
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
所以...我需要找出这个命令是否存在于帮助库中:
add-apt-repository
add-apt-repository似乎是python-software-properties安装程序的一部分。我在这一步骤中并没有看到任何真正的错误,除了在构建的其他区域弹出的这些消息。因此,我假设如果我能解决这个问题,上述的python步骤将会按需要安装:
[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:
那么,如何设置术语或对话框?我认为-y选项可以实现此功能。