How does a multi container Elasticbeanstalk environment update it's docker containers?

191 views Asked by At

I've setup an EB instance that runs two Docker containers, these containers are retrieved from an ECS registry and have the correct push/pull setup.

So if I build a new docker image via codebuild and have it push to our registry, how does EB (using a multi docker container setup) pull in the new image? I've set my Dockerun file to point to the latest container! Here is my Dockerrun.aws.json file:

{
  "AWSEBDockerrunVersion": 2,
  "volumes": [
    {
      "name": "rest-api",
      "host": {
        "sourcePath": "/var/app/current/rest-api"
      }
    },
    {
      "name": "thumbd",
      "host": {
        "sourcePath": "/var/app/current/thumbd"
      }
    }
  ],
  "containerDefinitions": [
    {
      "name": "rest-api",
      "image": "<ECS_REGISTRY_URL>",
      "essential": true,
      "memory": 128,
      "mountPoints": [
        {
          "sourceVolume": "rest-api",
          "containerPath": "/var/www/html",
          "readOnly": true
        }
      ]
    },
    {
      "name": "thumbd",
      "image": "<ECS_REGISTRY_URL>",
      "essential": true,
      "memory": 128,
      "mountPoints": [
        {
          "sourceVolume": "thumbd",
          "containerPath": "/var/www/html",
          "readOnly": true
        }
      ]
    }
  ]
}

Question:

  1. How does this work internally?
  2. Is there something I need to setup to have EB automatically use the :latest container as soon as it updates?
0

There are 0 answers