I've a system running on docker, my system has an specific test environment which might need to update the image version several times on a day...
So every time a new version need to be placed, i need to open the compose.yml file, look the container and edit the image version, then re-run docker compose up -d
So to skip this boring process of edit the compose.yml file, I had one idea: in the pipeline which builds and publishes the docker image, i create a new tag $image_name:latest-test
and a new step which publishes the image to this tag
so on any image update in my pipeline two tags are created, one with the version number and other with the latest-test... both are published to dockerhub and this process works like a charm
but even when a new image is published to dockerhub and i run docker compose up -d
no matter if the container is running or not, docker doesn't check if the image we have cached is really the one on dockerhub... it assumes the cache is the latest one and dont update
THE QUESTION IS:
1 - is there any way to force docker to check if the cached image has been updated on dockerhub?
2 - is there any other workaround i can do to keep a specific tag on my compose.yml file and update the image when needed without needing to edit the file 1000 times a day?
thanks