命令在弹性beanstalk中的dockeraws.json中不起作用AWSEBDockerrunVersion:2

时间:2015-07-20 11:27:14

标签: django docker elastic-beanstalk

您好我有一个小型的docker容器,我想运送到elasticbeanstalk 所以这是我的配置:

用于构建映像的我的Dockerfile:

FROM mwaaas/sms_packages:0.0.2

WORKDIR /root

# create a folder code where we will put our code
RUN mkdir code

# add code to the folder
ADD . code

WORKDIR /root/code

CMD gunicorn --bind=0.0.0.0:3000 --env DJANGO_SETTINGS_MODULE=sms_platform.settings sms_platform.wsgi

EXPOSE 3000

并且Dockerrunaws.json以这种方式配置

{
  "AWSEBDockerrunVersion": "2",
  "containerDefinitions": [
    {
      "name": "sms_platform_app",
      "image": "mwaaas/sms_platform:{{version}}",
      "essential": true,
      "memory": 128,
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 3000
        }
      ]
    }
  ]
}

如果我查看日志: ddef82a9bc59 mwaaas / sms_platform:staging_“/ bin / sh -c'gunicor

由于某些原因,我希望gunicorn命令在Dockerrunaws.json中 所以我删除了docker文件中的CMD命令 将其修复在Dockerrunaws.json文件中

{
  "AWSEBDockerrunVersion": "2",
  "containerDefinitions": [
    {
      "name": "sms_platform_app",
      "image": "mwaaas/sms_platform:production_32b7",
      "essential": true,
      "memory": 128,
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 3000
        }
      ],
      "command": "gunicorn --bind=0.0.0.0:3000 --env DJANGO_SETTINGS_MODULE=sms_platform.settings sms_platform.wsgi"
    }
  ]
}

有些弹性beanstalk没有运行命令。 当我查看日志时,我看到: 67798ba99a94 mwaaas / sms_platform:staging_b68d“/ sbin / my_init”

我希望命令是gunicorn而不是/ sbin / myinit

0 个答案:

没有答案