Docker compose 报错并解决——ERROR: Service ‘nginx‘ failed to build: ADD failed: file not found in build co

Docker compose 报错并解决——ERROR: Service 'nginx' failed to build: ADD failed: file not found in build context or excluded by .dockerignore: stat run.sh: file does not exist

  • 报错信息——ERROR: Service 'nginx' failed to build: ADD failed: file not found in build context or excluded by .dockerignore: stat run.sh: file does not exist
    • 解决思路

)

报错信息——ERROR: Service ‘nginx’ failed to build: ADD failed: file not found in build context or excluded by .dockerignore: stat run.sh: file does not exist

解决思路

先查看报错信息
Docker compose 报错并解决——ERROR: Service ‘nginx‘ failed to build: ADD failed: file not found in build co_第1张图片

因为是用的是dockerfile直接部署的nginx 所以用的也是之前的Dockerfile
Docker compose 报错并解决——ERROR: Service ‘nginx‘ failed to build: ADD failed: file not found in build co_第2张图片
其次就是我把CMD运行的命令脚本名字写错了在这里插入图片描述
在这里插入图片描述
Docker compose 报错并解决——ERROR: Service ‘nginx‘ failed to build: ADD failed: file not found in build co_第3张图片
最后成功了
在浏览器中输入地址和端口
Docker compose 报错并解决——ERROR: Service ‘nginx‘ failed to build: ADD failed: file not found in build co_第4张图片

你可能感兴趣的:(docker,报错,docker)