Skip to content

Instantly share code, notes, and snippets.

@ColinLeverger
Created December 8, 2016 11:36
  • Star 32 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ColinLeverger/b87957eb2e2256646718f13d156e6982 to your computer and use it in GitHub Desktop.
Update all Docker images
docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull
@bradynpoulsen
Copy link

I find that I have multiple versions of an image, adding a uniq -u squashes it down to unique lines

$ docker images | grep -v REPOSITORY | awk '{print $1}' | uniq -u | xargs -L1 docker pull 

@TheCjw
Copy link

TheCjw commented Aug 23, 2017

update from current TAG

# docker images | grep -v REPOSITORY | awk '{printf("%s:%s\n", $1, $2)}' | xargs -L1 docker pull

@hetykai
Copy link

hetykai commented Mar 9, 2018

update images with tag latest

docker images --format "{{.Repository}}:{{.Tag}}" | grep :latest | xargs -L1 docker pull

@enoch85
Copy link

enoch85 commented Apr 12, 2018

This doesn't seem to work anymore, any update? Btw please ping me with @enoch85

@RemeJuan
Copy link

@enoch85, I just used Brayden's command with success

Copy link

ghost commented Jun 10, 2018

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

@djds
Copy link

djds commented Jan 8, 2019

Update images with current tag @hetykai:

docker images --format "{{.Repository}}:{{.Tag}}" | xargs -L1 docker pull

@giggio
Copy link

giggio commented Apr 30, 2019

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.

@michaellwest
Copy link

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