Created
December 8, 2016 11:36
-
-
Save ColinLeverger/b87957eb2e2256646718f13d156e6982 to your computer and use it in GitHub Desktop.
Update all Docker images
This file contains 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 images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull |
update from current TAG
# docker images | grep -v REPOSITORY | awk '{printf("%s:%s\n", $1, $2)}' | xargs -L1 docker pull
update images with tag latest
docker images --format "{{.Repository}}:{{.Tag}}" | grep :latest | xargs -L1 docker pull
This doesn't seem to work anymore, any update? Btw please ping me with @enoch85
@enoch85, I just used Brayden's command with success
To update the docker images with the current tag use this command:
docker images | grep -v REPOSITORY | awk '{printf $1; printf ":"; print $2}' | xargs -L1 docker pull
Update images with current tag @hetykai:
docker images --format "{{.Repository}}:{{.Tag}}" | xargs -L1 docker pull
I have been using this one:
docker images --format "{{.Repository}}:{{.Tag}}" | grep --invert-match '<none>' | xargs -L1 docker pull
It removes the untagged images and pulls all by tag.
For PowerShell users this could be helpful:
docker images --format "{{.Repository}}:{{.Tag}}" | ForEach-Object { docker pull $_ }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I find that I have multiple versions of an image, adding a
uniq -u
squashes it down to unique lines