If the services used in a docker-compose.yml file have got updates and you want to update these on your deployed docker containers, then run the following commands.
Steps:
1] Go to the directory where the docker-compose.yml file is.
2] Pull the latest images for the services:
docker-compose pullBash3] Recreate the containers with the latest images:
docker-compose up --force-recreate -dBashThis will ensure that the services are updated to their latest versions and restarted with the new images.
4] As a single command you can also run:
docker-compose pull && docker-compose up --force-recreate -dBash