Score:0

Elastic Beanstalk: Not upgrading to newest docker container?

kr flag

I've been banging my head against this for days now and can't seem to figure out the last step. I'm trying to deploy a nodejs app as part of a multi container setup to elastic beanstalk.

Everything seems to work but when I upload a new application version (eb deploy) the environment no docker pull is performed to get the newest version of the container. Instead, the image that is stored on the machine is used which contains the old application code.

My Dockerrun.aws.json file:

{
    "AWSEBDockerrunVersion": 2,
    ....
    "containerDefinitions": [
        {
            "name": "core",
            "image": "xxx/core:latest",
            "hostname": "core",
            "essential": true,
            "portMappings": [
                {
                    "hostPort": 80,
                    "containerPort": 8012
                }
            ],
            "links": ["redis"],
            "memory": 600
        },
        {
            "name": "redis",
            "image": "redis:6.2-alpine",
            "hostname": "redis",
            "essential": true,
            "memory": 300,
            "portMappings": [
                {
                    "hostPort": 6379,
                    "containerPort": 6379
                }
            ],
        }
    ]
}

My codebuild file (buildspec.yml)

version: 0.2
phases:
    build:
        commands:
            - echo Build started on `date`
            - echo Building the production Docker image...
            - echo "$DOCKER_PW" | docker login -u "$DOCKER_ID" --password-stdin
            - docker build -t xxx/core .
    post_build:
        commands:
            # Take these images and push them to Docker hub
            - docker push xxx/core
artifacts:
    files:
        - Dockerrun.aws.json
        - .ebextensions/**/*

I've checked that a new image is pushed on every deploy (works!). I've checked that eb downloads the latest version of the Dockerrun file (works!) I can even "seemingly" see the downloads of the image increase on docker-hub, but when I ssh on the machine, the persisted image is old. I'm stuck!

I'm so happy for any help.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.