Left sidebar

Watchtower (WID:20200710114254-watchtower)

Last modified: 12 Aug 2020

Watchtower is an application that will monitor your running Docker containers and watch for changes to the images that those containers were originally started from. If watchtower detects that an image has changed, it will automatically restart the container using the new image.

With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.

Just execute the container with the docker socket mounted.

docker run -d \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower

It also supports pulling from private or authenticated image registries.

It can be set to watch only one, or a set of containers. Also it can be used as part as a docker-compose file to only update the containers defined in that stack.

It can send notifications of the updates via multiple channels (see doc).

It can be set to manage remote docker instances if the docker daemon listens to TCP.