Update Docker Compose images and recreate containers
docker compose update images | docker compose pull and up | update containers to latest image | docker | compose | updateCaution: This command changes the system. Understand what it does before you run it.
docker compose -f /opt/app/compose.yaml pull && docker compose -f /opt/app/compose.yaml up -dpull fetches the current image for the given tag of each service, then up -d recreates the affected containers and starts them in the background. Data in volumes is preserved, the affected services are briefly unavailable.
Note: With tags like latest, an update may bring a new major version, for example a database that needs a migration. Fixed version tags in the Compose file are safer. Remove old images afterwards with docker image prune.
Also searched as
- docker compose update images
- docker compose pull and up
- update containers to latest image