Created
May 11, 2018 14:08
-
-
Save tronyx/9496615e4a3b88d22eb2e9bbf16cc597 to your computer and use it in GitHub Desktop.
Basic script to detect and update active Docker container images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -aq > docker_ids.txt | |
while read CONTAINER | |
do | |
docker inspect ${CONTAINER} |grep -v sha |grep Image |awk '{print $2}' |tr -d '",' | |
done < docker_ids.txt > docker_images.txt | |
while read IMAGE | |
do | |
docker pull ${IMAGE} | |
done < docker_images.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment