|18118c2e73||2 months ago|
|log||5 years ago|
|.dockerignore||4 years ago|
|.drone.yml||4 years ago|
|.gitignore||3 years ago|
|Dockerfile||4 years ago|
|LICENSE||5 years ago|
|README.md||4 years ago|
|client.go||4 years ago|
|cron.go||4 years ago|
|docker-compose.yml||4 years ago|
|docker-stack.yml||2 months ago|
|env.go||5 years ago|
|env_test.go||5 years ago|
|go.mod||4 years ago|
|go.sum||2 months ago|
|main.go||4 years ago|
|swarm.go||4 years ago|
|swarm_test.go||4 years ago|
|tools.go||5 years ago|
|version.go||4 years ago|
Automatically update Docker services whenever their image is updated. Inspired on v2tec/watchtower
Every command-line option has their corresponding environment variable to configure the updater.
--host, -HDocker daemon socket to connect to. Defaults to "unix:///var/run/docker.sock" but can be pointed at a remote Docker host by specifying a TCP endpoint as "tcp://hostname:port". The host value can also be provided by setting the
--config, -cDocker client configuration path. In this directory goes a
config.jsonfile with the credentials of the private registries. Defaults to
~/.docker.The path value can also be provided by setting the
--schedule, -sCron expression in 6 fields (rather than the traditional 5) which defines when and how often to check for new images. An example:
--schedule "0 0 4 * * *". The schedule can also be provided by setting the
SCHEDULEenvironment variable. Defaults to 5 minutes.
--label-enable, -lWatch services where the
xyz.megpoid.swarm-updater.enablelabel is set to true. The flag can also be provided by setting the
LABEL_ENABLEenvironment variable to
--blacklist, -bService that is excluded from updates. Can be defined multiple times and can be a regular expression. Either
--blacklistcan be defined, but not both. The comma separated list can also be provided by setting the
--tlsverify, -tUse TLS when connecting to the Docker socket and verify the server's certificate. The flag can also be provided by setting the
DOCKER_TLS_VERIFYenvironment variable to
--debug, -dEnables debug logging. Can also be enabled by setting the
--help, -hShow documentation about the supported flags.
Other environment variables
DOCKER_API_VERSIONto set the version of the API to reach, leave empty to use the minimum required for the app.
DOCKER_CERT_PATHis the directory to load the certificates from. Used when
--hostis a TCP endpoint.
Private registry auth
A file must be placed on
~/.docker/config.json with the registry credentials (can be overriden with
DOCKER_CONFIG). The file can be created by using
docker login <registry> and saving the credentials.
Delay swarm-updater to be the last updated service
You must add the
xyz.megpoid.swarm-updater=true label to your service so the updater can delay the update of itself as the last one.
Only update the image but don't run the container
You must add the
xyz.megpoid.swarm-updater.update-only=true label to your service so only the image will be updated (useful for cron tasks where the container isn't running most of the time). Note: the service will be reconfigured with
replicas: 0 so this does nothing with global replication.