[英]Install MongoDB and Tomcat using Dockerfile
I was using the Dockerfile
mentioned below to install packages of python
, mongodb
and tomcaton
Centos6. 我正在使用Dockerfile
安装python
, mongodb
和tomcaton
Centos6的软件包。
FROM centos:centos6
RUN yum install -y centos-release-scl && \
yum install python27 &&
echo -e "[mongodb-org-3.2]\nname=MongoDB Repository\nbaseurl==https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/\ngpgcheck=1\nenabled=1\ngpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" > /etc/yum.repos.d/mongodb-org.repo && \
yum install -y mongodb-org && \
yum install -y tomcat6
CMD ["/bin/bash"]
I was getting the error below 我在下面收到错误
Your transaction was saved, rerun it with: 您的交易已保存,请使用以下命令重新运行:
yum load-transaction /tmp/yum_save_tx-2016-12-16-05-51EmkBfY.yumtx
The command 命令
/bin/sh -c yum install -y centos-release-scl && yum install python27 && echo -e "[mongodb-org-3.2]\nname=MongoDB Repository\nbaseurl==https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/\ngpgcheck=1\nenabled=1\ngpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" > /etc/yum.repos.d/mongodb-org.repo && yum install -y mongodb-org && yum install -y tomcat6
returned a non-zero code: 1
Not sure what would be the possible problem? 不知道可能是什么问题?
Use the following dockerfile
: 使用以下dockerfile
:
FROM centos:centos6
RUN yum install -y centos-release-scl && \
yum install -y python27 && \
echo -e "[mongodb-org-3.2]\nname=MongoDB Repository\nbaseurl==https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/\ngpgcheck=1\nenabled=1\ngpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" > /etc/yum.repos.d/mongodb-org.repo && \
yum install -y mongodb-org && \
yum install -y tomcat6
CMD ["/bin/bash"]
You were missing -y
before python27
and \\
after python27 &&
. 你失踪-y
之前python27
和\\
后python27 &&
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.