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.