Skip to content

Instantly share code, notes, and snippets.

@KMR-zoar
Last active March 14, 2018 03:05
Show Gist options
  • Save KMR-zoar/cc82287da82f56472cdb147585cd9989 to your computer and use it in GitHub Desktop.
Save KMR-zoar/cc82287da82f56472cdb147585cd9989 to your computer and use it in GitHub Desktop.
docker images Refresh
#!/bin/bash
docker images | grep latest | awk '{print $1}' | xargs -IXX docker pull XX
dangling=`docker images -f dangling=true -q | wc -l`
if [ $dangling != '0' ]
then
docker images -f dangling=true -q | xargs docker rmi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment