With insights from https://github.com/docker/docker/issues/29265
the behaviour is the same as the one from docker-compose
* connect to 1 network (at random) at start
* disconnect from that network
* reconnect to all the network from the previous configuration
This causes authentication failures on registries that don't match, including public registries.
Fallback to no-authentication to handle the case of public registries.
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.
Since Zodiac always uses image IDs for deployments we can relay on the
standard container image field to determine the image that was used to
start the container. Luckily, Zodiac writes the original image name to a
label in the container metadata. If we find that Zodiac-specific label
on a running container we will use the associated value when trying to
determine if the container's image has changed.
No need to export this particular struct since we already have a public
Client interface available and a NewClient function which can be used to
instantiate the concrete struct.
If we receive an error while trying to shutdown/startup a particular
container we don't want to immediately terminate the current update
cycle. Instead we should continue processing the remaining containers
and simply log the error.
Under certain conditions when watchtower is monitoring a Docker Swarm
cluster there would be cases where an updated container could not be
started because the old hadn't yet been removed (name conflicts, mapped
port conflicts, etc). We suspect that this has something to do with the
async nature of swarm and even though we've asked the swarm master to
remove a container it may not be completely removed from the associated
node. The fix is to do some polling after the remove container call to
ensure that the container is truly gone before proceeding.