Pull and Run Latest Docker Image With One Line Using Docker Compose

In case the docker image with latest tag has been updated, we can use below one-line script to pull the updated version and recreate container.

docker pull docker-image:latest && docker compose -f ~/apps/docker-compose.yml up -d

After that, we can use below script for cleaning up dangling images.

docker image prune

Comments

Leave a Reply

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