Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Beanstalk docker image automatic update doesn't work

I have a node.js application packaged in a docker image hosted in a public repository.

I have deployed that image in an AWS Beanstalk docker application successfully. The problem is that I was expecting the Beanstalk application to be automatically updated when I update the image in the public repository, as the following configuration sugggests.

Dockerrun.aws.json:

{
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "peveuve/dynamio-payment-service",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": "8000"
    }
  ],
  "Logging": "/var/log/dynamio"
}

The Dockerfile is very simple:

FROM node:4.2.1-onbuild
# Environment variables
ENV NODE_ENV test
ENV PORT 8000
# expose application port outside
EXPOSE $PORT

The Amazon documentation is pretty clear on that:

Optionally include the Update key. The default value is "true" and instructs Elastic Beanstalk to check the repository, pull any updates to the image, and overwrite any cached images.

But I have to update the Beanstalk application manually by uploading a new version of the Dockerrun.aws.json descriptor. Did I miss something? Is it supposed to work like that?

like image 863
peveuve Avatar asked Dec 12 '15 15:12

peveuve


People also ask

Does Docker automatically pull latest?

By default, Docker pulls the latest version. To ensure it does so, you can add the :latest tag.

Is Elastic Beanstalk outdated?

Release: Elastic Beanstalk Amazon Linux AMI platforms are deprecated on July 8, 2021. This release announces the deprecation of AWS Elastic Beanstalk platforms based on Amazon Linux AMI (aka AL1). Final retirement date is set to June 30, 2022.


1 Answers

The documentation should be more clear. What they are saying is with update=true:

EBS will do a docker pull before it does a docker run when the application is first started. It will not continually poll docker hub.

In contrast, issuing a docker run without first doing a docker pull will always use the locally stored version of that machine, which may not always be the latest.

In order to acheive what you want, you'll need to set up a webhook on Docker Hub, that calls an application you control, that rebuilds your ELB app.

like image 116
code_monk Avatar answered Oct 04 '22 01:10

code_monk