-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding image hash id when checking and pulling the image #1175
Comments
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! 🙏 |
It's not watchtower that adds the hash. Some tool you are using is probably pinning the image version to that hash to prevent unexpected upgrades. Watchtower could just ignore the hash, but that would circumvent the explicitly stated "don't upgrade this container" flag that someone put on it. Also, it might break the connection to that tool that initially put it there in the first place, since it probably doesn't expect it to suddenly run another image without any pinned hash. |
@piksel Could it be related to the fact that services are running in a swarm? Also I tried deploying with and without "latest" tag. No difference there. Also I tried to deploy only the stack that is related to our private registry leaving out services like Portainer, Grafana, Loki, Consul - again, no difference. I'm kind of clueless. |
@ipajumets Yes, docker swarm pins images to hashes. It's probably possible to make watchtower able to update those images and play nicely with swarm, but none of the maintainers currently use swarm and have a good enough idea about how it should behave. |
It should be documented that Watchtower is not compatible with docker swarm if this isn't going to be fixed. I wasted hours attempting to get this to work until I stumbled on this issue. |
@wmandra There isn't any fix. Swarm pins the container images to specific hashes which means that the latest version of the image is always the same. Even if watchtower would ignore that it's pinned, it has no way of telling what tag/image/repo to check for a later version, since that field just contains the image hash instead. If you are running watchtower v1.5.0+ it explicitly logs that it cannot update pinned containers:
Update: Actually, just removing the |
@piksel I'd be happy to test it. On my installation Watchtower does see the image tag with the hash appended to the end. Swarm behavior should be fine depending on what command Watchtower uses. On a swarm install all that's needed is to call: docker service update <service_name> --image <image_tag> I'll tray to take a look at the Watchtower code over the next few days and see if something might be possible. |
Watchtower doesn't use commands, it's communicating directly with the docker daemon through the api. If you want to run swarm-specific stuff, it seems like it would be easier to use watchtower with |
Hi there, I've been through the same issue with a Portainer based stack (environment is Swarm)
( But when Watchtower is checking for new version, it includes the sha version:
And as it includes sha version, Watchtower won't notice a newest version. Any idea? Thank you! |
@t-keller docker swarm. Even though it's not visible in |
Indeed, you're right :( But I remain surprised this requirement can't be addressed natively by Portainer or ArgoCD. Any different approach? |
What's the problem?
When Watchtower is checking and pulling images from our private registry it's adding image hash id to image name and tag. That way there is no way to identify if newer image is available or not.
Linked issues
The closest issue to my problem I've found is #1050.
Environment
Containers are running as services in a stack. There are 4 different stacks in a 3 manager, 2 worker node Docker swarm. Watchtower is deployed on every single node.
Logs
Expected behaviour
As far as I understand it should only be checking the image tag in order to identify newer images.
The text was updated successfully, but these errors were encountered: