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

I don’t know why but I cannot seem to figure out why this is happening. I can build and run the docker image locally.

Recent Events:

  • Docker inspect format to retreive IP of a particular network
  • Docker Remote API on windows native
  • Docker registry image won't start - “exec format error”
  • how to link docker container to each other with docker-compose
  • Issue in deploying a simple docker image to openshift
  • when using docker ESTABLISHED connections don't appear in netstat
  • 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 logs as attachment at: https://forums.aws.amazon.com/thread.jspa?threadID=181270

    Any help is extremely appreciated.


    @nick-humrich suggestion of trying eb local run worked. So using eb deploy ended up working.

    I had previously been uploading through the web interface.

    Initially using eb deploy was giving me a ERROR: TypeError :: data must be a byte string but I found this issue which was resolved by uninstalling pyopenssl.

    So I don’t know why the web interface was giving me permission denied perhaps something to do with the zip file?

    But anyway I’m able to deploy now thank you.

  • Cannot get a valid response from Docker Registry remote API
  • jBPM-Workbench-Showcase docker image: internal git accessing/ clone function does not work
  • Cannot find module '/parse/cloud/main.js' in Docker Parse Server
  • gitlab docker ssh issue
  • ARG substitution in RUN command not working for Dockerfile
  • How to use docker to create a minimal live ISO that runs docker?
  • One Solution collect form web for “Why am I getting a permission denied error on docker/aws eb?”

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

    Apparently, even though I had run RUN chmod +x /path/to/my_script.sh during the Docker build, by the time the image was run, the permissions had been changed. Eventually, to make it work I settled on:

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

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.