When I run the following command, isn’t this supposed to download the latest image from the Docker repository and rebuild the entire container?
sudo docker-compose up -d
I’m running Homebridge which released an update yesterday so I ran the command, but all it showed was “homebridge is up-to-date”.
No its not, it checks if you allready have the image with the correct label and tags, if it exists, it uses it.
If you want to update, you use “docker-compose pull”
Normally, you control when to update, because if you just make a configuration change and run “docker-compose up -d”, you dont want it to update also.
There is, also images where it autoupdates, fx. Docker Hub
I get you, but this is my home environment that is where I’m lazy. My script exports the container and I would like it to update automatically if there’s an update. This would happen using “docker-compose pull” then? Or do I have to run “docker-compose up -d” as well?
pull only downloads the new image, and then you need to use “up -d” to redeploy, it will see that there is a newer version of the image and recreate the container(s) using that image
Only if the image tag is the same. Some people use the ‘latest’ tag for that reason and, whilst that might be ok when you are just playing around, for a more resilient environment it is typically considered best practice to be explicit with image tags (e.g. an-image:v1.0.0, an-image:v1.1.0, etc.). If you use explicit image tags then you will need to update your compose file to reflect the one you want to use, or pass it as an arg.