Updating Docker containers
February 19, 2024
Since this will be such a short article, no since in wasting time with the overview/conclusion.
Updating Docker containers with Compose
This only applies to Docker Compose. If you’re not using that, you really should be. It makes dealing with containers exponentially easier.
First, you need to pull any new container images. This can be done with sudo docker compose -f /path/to/yaml pull
. Once the new images are downloaded, it is as simple as executing sudo docker compose -f /path/to/yaml up -d
. This will update any containers that had a newer version pulled. If you want to cleanup old images while your updating things, simply use sudo docker image prune
.
Quick and easy.