为什么我得到docker / aws eb上的权限被拒绝?

我不知道为什么,但我似乎无法弄清楚为什么会发生这种情况。 我可以在本地构build并运行Docker镜像。

最近发生的事件:

2015-05-25 12:57:07 UTC+1000 ERROR Update environment operation is complete, but with errors. For more information, see troubleshooting documentation. 2015-05-25 12:57:07 UTC+1000 INFO New application version was deployed to running EC2 instances. 2015-05-25 12:57:04 UTC+1000 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. 2015-05-25 12:57:04 UTC+1000 ERROR [Instance: i-4775ec9b] Command failed on instance. Return code: 1 Output: (TRUNCATED)... run Docker container: vel="fatal" msg="Error response from daemon: Cannot start container 02c057b331bf3a3d912bf064f1dca3e00c95746b5748c3c4a28a5c6b452ff335: [8] System error: exec: \"bin/app\": permission denied" . Check snapshot logs for details. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. 2015-05-25 12:57:03 UTC+1000 ERROR Failed to run Docker container: vel="fatal" msg="Error response from daemon: Cannot start container 02c057b331bf3a3d912bf064f1dca3e00c95746b5748c3c4a28a5c6b452ff335: [8] System error: exec: \"bin/app\": permission denied" . Check snapshot logs for details. 

Dockerfile:

 FROM java:8u45-jre MAINTAINER Terence Munro <terry@zenkey.com.au> ADD ["opt", "/opt"] WORKDIR /opt/docker RUN ["chown", "-R", "daemon:daemon", "."] USER daemon ENTRYPOINT ["bin/app"] EXPOSE 9000 

Dockerrun.aws.json:

 { "AWSEBDockerrunVersion": "1", "Ports": [ { "ContainerPort": "9000" } ], "Volumes": [] } 

其他日志作为附件在: https : //forums.aws.amazon.com/thread.jspa?threadID=181270

任何帮助,非常感激。


@ nick-humrich尝试eb local runbuild议工作。 所以使用eb deploy结束了工作。

我以前一直通过networking界面上传。

最初使用eb deploy给了我一个ERROR: TypeError :: data must be a byte string但我发现这个问题已经通过卸载pyopenssl解决。

所以我不知道为什么Web界面给我的权限被拒绝也许是与zip文件有关?

但无论如何,我现在能够部署谢谢你。

在Elastic Beanstalk上运行Docker时遇到类似的问题。 当我将Dockerfile中的CMD指向shell脚本( /path/to/my_script.sh )时,EB部署将失败,并显示/path/to/my_script.sh: Permission denied.

显然,即使我已经在Docker构build过程中运行了RUN chmod +x /path/to/my_script.sh ,在映像运行的时候,权限已经改变了。 最终,为了使它工作,我决定:

CMD ["/bin/bash","-c","chmod +x /path/to/my_script.sh && /path/to/my_script.sh"]