Registry authentication was failing silently when pulling images.

Load authentication credentials for available credential stores in order of preference:
 1. Environment variables REPO_USER, REPO_PASS
 2. Docker config files
Request image pull with authentication header.
Wait until pull request is complete before exiting function.
This commit is contained in:
Ross Cadogan 2016-10-18 13:54:41 +01:00
parent ef430b791a
commit 1c59200565
4 changed files with 128 additions and 20 deletions

View file

@ -39,6 +39,16 @@ docker run -d \
centurylink/watchtower
```
If pulling images from a private Docker registry, supply any authentication credentials with the environment variables `REPO_USER` and `REPO_PASS` or omit to leave watchtower load credentials from the default Docker config (`~/.docker/config.json`):
```
docker run -d \
--name watchtower \
-e REPO_USER="<username>" -e REPO_PASS="<password>" \
-v /var/run/docker.sock:/var/run/docker.sock \
drud/watchtower container_to_watch --debug
```
### Arguments
By default, watchtower will monitor all containers running within the Docker daemon to which it is pointed (in most cases this will be the local Docker daemon, but you can override it with the `--host` option described in the next section). However, you can restrict watchtower to monitoring a subset of the running containers by specifying the container names as arguments when launching watchtower.