Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何将管道固定到Dockerfile中的外壳上,从而导致;无法执行二进制文件";错误_Linux_Bash_Docker - Fatal编程技术网

Linux 如何将管道固定到Dockerfile中的外壳上,从而导致;无法执行二进制文件";错误

Linux 如何将管道固定到Dockerfile中的外壳上,从而导致;无法执行二进制文件";错误,linux,bash,docker,Linux,Bash,Docker,我正在尝试将其中一个应用程序docker化,这就是我的docker文件的外观 FROM ubuntu:18.04 as base RUN apt-get update && apt-get install -y curl RUN curl -sL https://deb.flexiwan.com/setup | bash - apt-get install -y flexiwan-router RUN touch /etc/fwagent/token.txt 运行此操作时,

我正在尝试将其中一个应用程序docker化,这就是我的docker文件的外观

FROM ubuntu:18.04 as base

RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.flexiwan.com/setup | bash - apt-get install -y flexiwan-router

RUN touch /etc/fwagent/token.txt
运行此操作时,我看到以下错误:

步骤3/4:运行curl-sLhttps://deb.flexiwan.com/setup |bash-apt get安装-y flexiwan路由器
--->在a0e8ae9f9370中运行
/usr/bin/apt-get:/usr/bin/apt-get:无法执行二进制文件
命令'/bin/sh-ccurl-sLhttps://deb.flexiwan.com/setup |bash-apt get install-y flexiwan路由器“返回非零代码:126

我试图将shell改为bash,并引用了命令中的一些内容,但似乎没有任何效果。是否有办法解决此问题?

您必须拆分Dockerfile的一行,例如:

FROM ubuntu:18.04 as base

RUN apt-get update && apt-get install -y curl 
RUN curl -sL https://deb.flexiwan.com/setup | bash - 
RUN apt-get install -y flexiwan-router
RUN touch /etc/fwagent/token.txt

bash-apt get install…
应该做什么?也就是说,你认为这段代码应该完成什么?(一旦你回答了这个问题——呃,为什么你认为这段代码应该做这件事?如果你试图遵循Flexiwan人员的文档,引用这些文档不会有什么坏处)。它应该从存储库中安装软件包,我们只是使用从curl下载的脚本安装。更具体地说:为什么您认为
bash-apt get
是正确的,都在一行上?是的,我的错。。。。。