首页 > 解决方案 > 在 Docker 中运行可执行的 Bash 脚本

问题描述

我有一个 Docker 容器(在这里你可以找到 dockerfile 定义https://gist.github.com/ypriverol/05002f5c6477034fef0f05fae25e4f8b

Bash 脚本如:

 #!/bin/bash
 echo "Analysing Data"
 exec mono /home/bin/tool.exe "$@"

当我以这种方式执行容器时,

  docker run -v /home/data:/data_input -i -t toolcontainer nameofscript -i=/data_input/fileinput -o=/data_input/ -m -c=PXD00001

我得到了错误:

standard_init_linux.go:190: exec 用户进程导致“exec 格式错误”

为什么我收到错误并且我无法执行包含单声道工具的脚本。?

标签: bashdocker

解决方案


推荐阅读