watchtower icon indicating copy to clipboard operation
watchtower copied to clipboard

image updaed but contianer not

Open Paleozoic opened this issue 3 years ago • 5 comments

Describe the bug i push an image to my private docker hub,then watchtower pull it automatically,seems everything is ok i use the command docker save 6ba9e53fe298 > xxx.zip to save the image,i check the class in the jar of the image.the code is latest. but when i request the api, the api response is for the last version. then i rebuild the contianer by portainer,the app also performs last version api. then i remove the contianer by portainer.then create it,now the app performs latest version api. To Reproduce

  1. run watchtower by command:
docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
     -v /xxx/config.json:/config.json \
    containrrr/watchtower --cleanup --interval 30 
  1. show watchtower log:docker logs -f watchtower
  2. push image to private docker hub
  3. wait for the updating by watchtower:
time="2022-07-15T00:48:14Z" level=info msg="Found new xxxx:latest image (5cf8199e59ba)"
time="2022-07-15T00:48:18Z" level=info msg="Stopping /xxxx (26affe0ab848) with SIGTERM"
time="2022-07-15T00:48:19Z" level=info msg="Creating /xxxx"
time="2022-07-15T00:48:20Z" level=info msg="Removing image f3581f301c73"
  1. request the api to check if its response is the latest.(Expecte api version updated but not ),but i use command docker save 6ba9e53fe298 > xxx.zipto save the image of runtime and check the code,the code is latest.(what?!)
  2. login portainer,try stop&start kill&start and restart,also app performs old version api image
  3. then i remove the container and add a new container for the same image(not pull it again),app performs latest version api
  4. i try 1-7 serveral times Expected behavior when watchtower pull the latest image,container rebuild automatically,and app performs latest version api.

Screenshots

Environment

  • Platform: Linux version 3.10.0-1127.8.2.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue May 12 16:57:42 UTC 2020
  • Architecture:
  • Docker version :Docker version 20.10.17, build 100c701

Paleozoic avatar Jul 15 '22 02:07 Paleozoic

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! 🙏

github-actions[bot] avatar Jul 15 '22 02:07 github-actions[bot]

I don't this is a problem with watchtower.

I use the command docker save 6ba9e53fe298 > xxx.zip to save the image, I check the class in the jar of the image, and the code is latest.

If the image is indeed the new version, then there is nothing more watchtower can do. I don't know how you are getting these odd results though. Perhaps log a version number in the startup and check what it says after a update? Also, you can check what the ID of the image is before and after updating:

docker inspect xxxx  | grep Image

Perhaps there is something caching your results? Or you are somehow connecting to the wrong instance?

piksel avatar Jul 15 '22 07:07 piksel

i try the cmd above before and after updating.the Image's sha256 has changed.watchtower pull the latest image.but also api gets the odd results. if i remove the container and add a new one,it is all right.

Paleozoic avatar Jul 20 '22 15:07 Paleozoic

when i get the odd results,i try these cmds and it works

docker stop xxx
docker rm xxx
docker run xxxx

Paleozoic avatar Jul 20 '22 15:07 Paleozoic

Hi..

Whats in your /xxx/config.json file?

SkipperDo avatar May 05 '23 03:05 SkipperDo