containrrr / watchtower

A process for automating Docker container base image updates.
https://containrrr.dev/watchtower/
Apache License 2.0
19.21k stars 854 forks source link

Add support for the registry-mirror docker option #1346

Open kasimon opened 2 years ago

kasimon commented 2 years ago

Is your feature request related to a problem? Please describe. Our docker daemons run with the registry-mirror=<internal-docker-proxy> setting set, as our systems cannot access the internet directly. We have configured sonatype nexus as a pass through cache for this. But we have not been able to enable this option for watchtower, resulting in watchtower trying to connect directly to external registries and failing.

Describe the solution you'd like Support the registry-mirror setting in config.json (we have mounted /etc/docker/daemon.json to /config.json) or provide an option WATCHTOWER_DOCKER_REGISTRY_MIRROR=... to watchtower.

github-actions[bot] commented 2 years ago

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

brechsteiner commented 1 year ago

+1

1983shake commented 3 months ago

+1

Kagee commented 3 months ago

Does watchtower pull the images on it's own, not through docker? We also require this option, and it is configured and works just fine when using the docker cli directly on host we run watchtower on, but when the watchtower container tries to update it claims

time="2024-07-24T14:26:43Z" level=warning msg="Could not do a head request for \"containrrr/watchtower:latest\", falling back to regular pull." container=/watchtower image="containrrr/watchtower:latest"
time="2024-07-24T14:26:43Z" level=warning msg="Reason: Get \"https://index.docker.io/v2/\": dial tcp: lookup index.docker.io: i/o timeout" container=/watchtower image="containrrr/watchtower:latest"
t

even tough i can see in the docker mirror logs that a HEAD request was issued and a response was sent?

kasimon commented 3 months ago

AFAIK watchtower doesn't pull images, but checks the registry for new images directly over the registry api.

uwang commented 1 month ago

+1

DavidZhang73 commented 1 week ago

+1