我的Dockerrun.aws.json

{
  "AWSEBDockerrunVersion": 2,
  "Authintication": {
    "Bucket": "abc",
    "key": "config.json"
  },
  "containerDefinitions": [
    {
      "name": "data",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "codebase",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "postgres",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/postgres:latest",
      "essential": true,
      "memory": 1024,
      "volumesFrom": [
        {
          "sourceContainer": "data"
        }
      ],
      "portMappings": [
        {
          "hostPort": 5432,
          "containerPort": 5432
        }
      ],
      "links": [
        "data"
      ]
    },
    {
      "name": "boxer-api",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/boxer-api:latest",
      "essential": true,
      "memory": 1024,
      "volumesFrom": [
        {
          "sourceContainer": "codebase"
        }
      ],
      "portMappings": [
        {
          "hostPort": 8080,
          "containerPort": 8080
        }
      ],
      "links": [
        "codebase",
        "postgres",
        "data"
      ]
    }
  ]
}

错误eb-activity.log



ECS代理日志:



如果您需要更多信息,请告诉我。

最佳答案

摔了两天后终于找到了。

发生这种情况是因为我的数据和代码库容器以退出代码“0”退出。我将命令更改为“tail -f/bin/bash/”。

前:

    {
      "name": "data",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    },
    {
      "name": "codebase",
      "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
      "essential": false,
      "memory": 512,
      "command" : [
       "/bin/bash"
      ]
    }

后:
       {
          "name": "data",
          "image": "id.dkr.ecr.eu-west-2.amazonaws.com/dbdata:latest",
          "essential": false,
          "memory": 512,
          "command": [
            "tail",
            "-f",
            "/bin/bash"
          ]
        },
        {
          "name": "codebase",
          "image": "id.dkr.ecr.eu-west-2.amazonaws.com/codebase:latest",
          "essential": false,
          "memory": 512,
         "command": [
           "tail",
           "-f",
           "/bin/bash"
         ]
        }

我仍然不明白为什么“基本”标志被忽略了!

关于docker - 无法启动Elastic Beanstalk MultiContainer实例,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43226124/

10-11 08:30