命令'/ bin / sh -c返回非零代码:127 [英] The command '/bin/sh -c returned a non-zero code: 127
本文介绍了命令'/ bin / sh -c返回非零代码:127的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是docker的新手,所以我可能做错了,但是我试图通过 Dockerfile
安装Tomcat6,如下所示:
I'm new to docker so I might be doing this wrong, but I'm trying to install Tomcat6 through a Dockerfile
which like this:
FROM rhel7:latest
RUN cd /tmp
RUN "wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz"
RUN tar xzf apache-tomcat-6.0.44.tar.gz
RUN mv apache-tomcat-6.0.44 /usr/local/tomcat6
RUN cd /usr/local/tomcat6
Run ./bin/start.sh
它在第三行失败,并带有:
Its failing on the 3rd line with the:
RUN "wget", "http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz"
当我运行docker build时,我得到了:
When I run the docker build I get this:
我正在使用:
- Oracle Virtual Box V4.3.28 r100309
- RHEL7上的Docker
谢谢您的帮助。
推荐答案
对图像有错误的解决方案是在 wget CMD
RUN yum -y install wget
Solution to the image with error is to add before the wget CMD
RUN yum -y install wget
如果这样写,则结果相同,只是执行不同:
If you write it like this, it is the same result, just different execution:
RUN wget http://www.us.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz
不要在 RUN
命令中使用引号和逗号。
Don't use the quotes and comma in RUN
command.
这篇关于命令'/ bin / sh -c返回非零代码:127的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文