[英]python: can't open file 'main.py': [Errno 2] No such file or directory - docker
As you have already specified the WORKDIR
in the Dockerfile
.因为您已经在
Dockerfile
中指定了WORKDIR
。 Dont' copy your files to /
.不要将文件复制到
/
。
Change your command to将您的命令更改为
COPY . . # If you want to copy whole folder into container
and as well CMD
command to以及
CMD
命令
CMD ["python", "src/main.py"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.