1

Docker Compose: Pull Latest Image Version

 2 years ago
source link: https://www.shellhacks.com/docker-compose-pull-latest-image-version/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Docker Compose: Pull Latest Image Version

The 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

The 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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK