9

I have created a Github repo and a Docker repo. Both work together very well: when I push a new version of Dockerfile to Github, a new image is automatically built inside the Docker repo.

Now, I'd like to have my running containers automatically updated when the base-image is (re)built.

How can I achieve it using Docker repos webhooks?

2

The Century Link Labs team have developed a 2 new open source tools that can use web hooks to update running containers.

Their 1st app is Zodiac that uses a "push" deployment model. Its a lightweight tool built on top of Docker Compose, for easy deployment and rollback of dockerized applications. It maintains a history of all deployments that also allows you to rollback to a previous deployment.

Their 2nd app Watchtower uses a "pull" deployment model. This model allows Docker containers that reside behind a firewall to detect and more safely pull changes without exposing an external port.

Watchtower knows how to properly restart a set of linked containers. If an update is detected for one of the dependencies in a group of linked containers, Watchtower will stop and start all of the containers in the correct order so that the application comes back up correctly.

I have no affiliation with Century Link Labs.

Another simpler app you might want to have a look at is Docker Puller.

0

There is also a more recent one docker-image-puller

It's connected directly to your Docker's socket and use the Docker API to update your running containers which use the image you specify in the webhook. It's pretty simple, maybe more options can be added in the future

-1

I found this, but I haven't tried yet:

https://medium.com/@iaincollins/docker-swarm-automated-deployment-cb477767dfcf this is an article about use webhook to deploy container with docker hub.

Basically, it tells you could use kind of tool(check the link below), to handle webhook on your docker "machine". https://github.com/iaincollins/docker-deploy-webhook

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Michael Hampton May 7 '18 at 16:32
  • @MichaelHampton I think my answer would be helpful, I added more description. – emj365 May 8 '18 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.