Watchtower updates the container by pulling the new image and recreate a new container of the new image. But the new container runs with the old healthcheck arguments instead of the updated ones:
If you manually re-create the container, e. g. using docker-compose pull and docker-compose up -d, the updated health check parameters will be applied to the new container:
Interesting! Yeah, I think we copy the current container spec to the teeth, including any healthcheck declarations that it might have. Will have to look into how to honor changes to it.
Describe the bug
An image specifies the health check with various arguments, e. g. the following health check:
container: (
$> docker inspect kjn2kj3498
)The image author updates the health check parameters, e. g. timeout will be increased to 15s, and retries to 4:
Watchtower updates the container by pulling the new image and recreate a new container of the new image. But the new container runs with the old healthcheck arguments instead of the updated ones:
$> docker inspect ui43j3na
If you manually re-create the container, e. g. using
docker-compose pull
anddocker-compose up -d
, the updated health check parameters will be applied to the new container:$> docker inspect asdn2904ds
Steps to reproduce
HEALTHCHECK --interval=5s --timeout=2s --start-period=10s --retries=3 CMD [ "/usr/bin/sleep", "1s" ]
ENTRYPOINT [ "/usr/bin/sleep", "10m" ]
timeout
andretries
ParameterHEALTHCHECK --interval=5s --timeout=15s --start-period=10s --retries=4 CMD [ "/usr/bin/sleep", "1s" ]
ENTRYPOINT [ "/usr/bin/sleep", "10m" ]
Expected:
Do the same with
docker-compose up -d --force-recreate
. The expected healthcheck configuration will be applied.Expected behavior
The container should be recreated with the updated healtcheck configuration
Screenshots
No response
### Environment
``` docker info Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.10.2 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.16.0 Path: /usr/libexec/docker/cli-plugins/docker-compose scan: Docker Scan (Docker Inc.) Version: v0.23.0 Path: /usr/libexec/docker/cli-plugins/docker-scan Server: Containers: 9 Running: 2 Paused: 0 Stopped: 7 Images: 347 Server Version: 23.0.1 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640 runc version: v1.1.4-0-g5fd4c4d init version: de40ad0 Security Options: seccomp Profile: builtin Kernel Version: 5.10.102.1-microsoft-standard-WSL2 Operating System: Ubuntu 20.04.6 LTS OSType: linux Architecture: x86_64 CPUs: 8 Total Memory: 12.27GiB Name: Wehrstedt ID: DDGC:2DRA:UQYD:5LEP:PAUW:AA4Y:XA6G:MJD5:SCWX:U6MM:3D5Z:Z2IV Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Default Address Pools: Base: 172.17.0.0/12, Size: 20 Base: 192.168.0.0/16, Size: 24 WARNING: No blkio throttle.read_bps_device support WARNING: No blkio throttle.write_bps_device support WARNING: No blkio throttle.read_iops_device support WARNING: No blkio throttle.write_iops_device support ```Your logs
Additional context
No response