Docker-Compose: Update images, redeploy and prune unused images

by

in

I really like simpel oneliner commands in general. For example I use this oneliner to update, redeploy containers with the latest images and remove old unused container images.

User1@hostname:/path/to/docker-compose.yaml# docker-compose pull && docker-compose up -d && docker image prune -a

You can add the following line to your .bashrc to make an alias containing all the above commands in a single command called “compose-upgrade”

alias compose-upgrade="docker-compose pull && docker-compose up -d && docker image prune -a"

After adding this line to your .bashrc do a reset or login again to make it active

User1@hostname:~# reset


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *