Why I receive permission denied in Docker deployment?

后端 未结 2 1199
生来不讨喜
生来不讨喜 2021-01-27 05:36

I have created an application in Elastic Beanstalk to host a play framework 2 app there using instructions from this project.

I have packaged the project exactly like Do

2条回答
  •  孤独总比滥情好
    2021-01-27 05:49

    Here's what I did to solve this same issue, though I'm not sure which part specifically solved it.

    My DockerFile looks like:

    FROM dockerfile/java
    MAINTAINER yourNameHere
    EXPOSE 9000 9443
    ADD files /
    WORKDIR /opt/docker
    RUN ["chown", "-R", "daemon", "."]
    # Make sure myApp is excutable
    RUN ["chmod", "+x", "bin/myApp"]
    USER daemon
    # If running a t1.micro or other memory limited instance
    # be sure to limit play memory. This assumes play 2.3.x
    ENTRYPOINT ["bin/myApp", "-mem", "512", "-J-server"]
    CMD []
    

    See https://www.playframework.com/documentation/2.3.x/ProductionConfiguration for info on setting jvm memory.

    My Dockerrun.aws.json (also required) looks like:

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

    Finally my play application lives in files/opt/docker with the run script in docker/bin. All this is zipped up and sent to EB.

提交回复
热议问题