Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EB: Automatically deploy new Docker image build from Docker Hub

Is it possible to setup a web hook to automatically deploy a new version of an application from a Docker Hub repository to Elastic Beanstalk?

I currently have the following setup:

Bitbucket Repo -----> Docker Hub -----> Elastic Beanstalk

When I push to the master branch on the git repository, it triggers a build on the Docker repository through a POST request. However, once the image is built, I have to manually deploy it on EB.

Docker Hub has the option for making a POST request whenever a build is successfully completed. Is there some API or URL that I could point Docker to call so that EB redeploys the application?

Note: Eventually I would like to include an automated testing server into this workflow.

like image 738
Eduardo Trujillo Avatar asked Jul 07 '14 06:07

Eduardo Trujillo


People also ask

Does Docker build automatically pull?

After pushing the image, the image is used as cache source on another machine. BuildKit automatically pulls the image from the registry if needed. On another machine: $ docker build --cache-from myname/myapp .

How do I push a new image to Docker Hub?

To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).


1 Answers

AWS does not seem to have a HTTP API, but you can use the aws command-line tool to trigger the update: https://stackoverflow.com/a/41715702/5879759

like image 177
a544jh Avatar answered Oct 07 '22 11:10

a544jh