docker-compose up command doesn’t check a registry for a newer version of an image if it finds the
image:latest among the locally cached images.
So after a while you may find, that despite of the
:latest tag of the image in a
docker-compose.yml file, the
docker-compose up command doesn’t pull the latest version of this image even though it is available in the registry.
Below i will show how to force the
docker-compose up command to pull the latest version of the images.
Cool Tip: Run a
docker-compose command against a single service! Read more →
Docker Compose: Pull Latest Image Version
Run the following commands to check if the running containers are outdated and if they are, pull the latest versions of the images and re-create the containers:
$ docker-compose pull && docker-compose up -d
docker-compose pull command above pulls the latest versions of the images and then the
docker-compose up -d command re-creates the containers from that images and starts them in a background.