简体   繁体   English

“ docker-compose up”失败并出现错误

[英]“docker-compose up” fails with error

I want to work on a project, but I need to use docker for running the app, but the docker-compose up command fails with this error: 我想从事一个项目,但是我需要使用docker来运行应用程序,但是docker-compose up命令失败,并显示以下错误:

System error: exec: "./wait_to_start": stat ./wait_to_start:
no such file or directory

The wait_to_start command is an executable python script in the subfolder backend/. wait_to_start命令是子文件夹backend /中的可执行python脚本。

I need to determine why it cannot be executed. 我需要确定为什么它不能执行。 Either it's been searched in the wrong path, or there are access right problems, or maybe the wrong python version is used. 在错误的路径中搜索了它,或者存在访问权限问题,或者使用了错误的python版本。

Can I debug it with details, or login with SSH and check the files on the virtual machine? 我可以使用详细信息对其进行调试,还是可以使用SSH登录并检查虚拟机上的文件? I'm too unexperienced with Docker... 我对Docker缺乏经验...

您可以设置“ workdir”元数据以确保在启动容器时位于正确的位置,或者只需调用/backend/wait_to_start而不是./wait_to_start因此无需在正确的目录中。

Do debug with docker-compose I would do this: 使用docker-compose调试,我会这样做:

docker-compose run --entrypoint bash <servicename>

That should give you a prompt and let you inspect the file and working directory, so see what's wrong. 这应该会提示您,并让您检查文件和工作目录,因此请找出问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM