[英]Docker volume mount: “no such file or directory”
I'm pretty new to Docker and trying to get my first (real) image up-and-running. 我对Docker很陌生,并试图让我的第一个(真实)图像正常运行。 I've written my Dockerfile:
我写了我的Dockerfile:
WORKDIR /myapp
VOLUME /myapp/configuration
VOLUME /etc/asterisk
VOLUME /usr/share/asterisk/sounds
So my container should start in /myapp
and I should be able to mount external volumes to configure my app ( configuration
), Asterisk and its sounds. 所以我的容器应该从
/myapp
开始,我应该能够安装外部卷来配置我的应用程序( configuration
),Asterisk及其声音。
Though, when I start a container with my image: 但是,当我用我的图像启动容器时:
docker run -it \
--entrypoint /bin/bash myapp \
-v $(pwd)/asterisk:/etc/asterisk \
-v $(pwd)/configuration:/myapp/configuration \
-v $(pwd)/asterisk/sounds:/usr/share/asterisk/sounds
It gives me the following error: 它给了我以下错误:
/bin/bash: /home/me/Docker/asterisk:/etc/asterisk: No such file or directory
I really don't understand why. 我真的不明白为什么。 I've verified it was not a line-ending issue (
CRLF
rather than expected LF
for example), and it's not. 我已经证实这不是一个行结束问题(例如
CRLF
而不是预期的LF
),但事实并非如此。 I really don't know. 我真的不知道。
If it counts, I'm running elementary OS Loki. 如果重要,我正在运行基本的OS Loki。
Please suggest. 请建议。
I found what the problem was, my hint was the unusual /bin/bash
beginning the line. 我发现了问题所在,我的提示是不正常的
/bin/bash
开头。
Actually, it was interpreting my -v
options as options for the entrypoint, and bash didn't understand it. 实际上,它将我的
-v
选项解释为入口点的选项,而bash并不理解它。
I moved my lines ( --entrypoint
is now the last option) and it works like a charm. 我移动了我的线条( -
--entrypoint
现在是最后一个选项),它就像一个魅力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.