为什么我在docker/aws eb上收到权限被拒绝错误?

ter*_*nro 5 amazon-web-services docker amazon-elastic-beanstalk

我不知道为什么,但我似乎无法弄清楚为什么会这样.我可以在本地构建和运行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.
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

Dockerrun.aws.json:

{
  "AWSEBDockerrunVersion": "1",
  "Ports": [
    {
      "ContainerPort": "9000"
    }
  ],
  "Volumes": []
}
Run Code Online (Sandbox Code Playgroud)

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

非常感谢任何帮助.


@ nick-humrich尝试eb local run工作的建议.所以使用eb deploy最终工作.

我以前通过网络界面上传.

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

所以我不知道为什么网页界面给我许可否认可能与zip文件有关?

但无论如何我现在可以部署了谢谢你.

SMX*_*SMX 4

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

显然,即使我RUN chmod +x /path/to/my_script.sh在 Docker 构建期间运行,但在运行映像时,权限已更改。最终,为了让它发挥作用,我决定:

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