Why am I getting permission denied on docker / aws eb?

I do not know why, but I cannot understand why this is happening. I can create and run docker images in local mode.

Latest events:

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": [] } 

Additional magazines as an attachment: https://forums.aws.amazon.com/thread.jspa?threadID=181270

Any help is greatly appreciated.


@ nick-humrich suggested trying eb local run . So using eb deploy ended up working.

I previously downloaded the web interface.

Initially, the use of eb deploy gave me ERROR: TypeError :: data must be a byte string , but I found this issue , which has been eliminated by removing pyopenssl.

So, I do not know why the web interface gave me permission to reject, maybe something to do with the zip file?

But anyway I can deploy now thanks.

+5
source share
1 answer

I had a similar problem with Docker on Elastic Beanstalk. When I pointed the CMD in the Dockerfile to the shell script ( /path/to/my_script.sh ), the EB deployment failed with the error /path/to/my_script.sh: Permission denied.

Apparently, although I was running RUN chmod +x /path/to/my_script.sh during the Docker build, the permissions were changed by the time the image was run. In the end, for it to work, I decided:

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

+1
source

All Articles