elastic-beanstalk docker app not updating upon deploy

amazon-ec2, amazon-elastic-beanstalk, amazon-s3, amazon-web-services, docker

Solution

The problem with using Docker for CI is that it doesn't act like a script in that it won't rebuild unless the `Dockerfile` changes. So you have to put the stuff that needs to be rebuilt every time in a startup wrapper script rather than in the `Dockerfile`. So I moved the part that downloads the application tarball into a script that the `Dockerfile` installs to the container. Then when the container starts the tarball is downloaded and unpacked and only then can the real application start. This works, and re-deploys now work as expected. Its a bit aggravating to debug the process and leads me to the opinion that using Docker with EB for CI is a bit of a hack.

Problem

I have a `Dockerfile`/`elastic-beanstalk` app in a `git` repo that pulls a tarball of the current release of the application from `s3` and launches it. This works great the first time I deploy; the Docker container gets built, and the app launches and runs correctly. The problem comes after I make a change to the app, re-upload the tarball to `s3` and run `eb deploy`. ``` $ eb deploy INFO: Environment update is starting. INFO: Deploying new version to instance(s). INFO: Successfully built aws_beanstalk/staging-app INFO: Successfully pulled yadayada/blahblah:latest INFO: Docker container 06608fa37b2c is running aws_beanstalk/current-app. INFO: New application version was deployed to running EC2 instances. INFO: Environment update completed successfully. ``` But the app has not updated on `*.elasticbeanstalk.com`. I'm guessing since the `Dockerfile` hasn't changed, docker doesn't rebuild the container (and pull the latest application tarball). I would like to be able to force a rebuild but the `eb` tool doesn't seem to have that option. I can force a rebuild from the website console, but obviously that is no good for automation. I am committing each change to `git` and I was hoping that `eb` would use that to know that a rebuild is necessary but that doesn't seem to make any difference. Am I using docker/elastic-beanstalk in the wrong way? Ideally I want to commit to `git` and have beanstalk automagically re-install the app.

Original source

Related problems