Update all Docker Containers with docker-compose

This command will cd into each directory and then run a command to fetch the latest images and restart the containers if there is an update.

It makes the assumption that you have a directory per service with a docker-compose file within.

for d in ./*/ ; do (cd "$d" && sudo docker-compose pull && sudo docker-compose --compatibility up -d); done

Cover image credit: https://unsplash.com/@dilucidus

Last modified: 31st October 2021

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.