命令 '/bin/sh -c 返回一个非零代码:127 [英] The command '/bin/sh -c returned a non-zero code: 127

查看:107
本文介绍了命令 '/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

它在第三行失败了:

  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前添加运行 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屋!

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