Skip to content
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

image updaed but contianer not #1323

Open
Paleozoic opened this issue Jul 15, 2022 · 5 comments
Open

image updaed but contianer not #1323

Paleozoic opened this issue Jul 15, 2022 · 5 comments

Comments

@Paleozoic
Copy link

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

@github-actions
Copy link

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

@piksel
Copy link
Member

piksel commented Jul 15, 2022

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?

@Paleozoic
Copy link
Author

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
Copy link
Author

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

docker stop xxx
docker rm xxx
docker run xxxx

@SkipperDo
Copy link

Hi..

Whats in your /xxx/config.json file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants