Pierre HUBERT
Pierre HUBERT

Reputation: 521

Update (pull) all docker images at once

Is there a command to update (pull) all the downloaded Docker images at once in the terminal ?

Upvotes: 12

Views: 4348

Answers (4)

Rameez Sheraz
Rameez Sheraz

Reputation: 51

grep v1.0-code_latest docker-compose.yml | awk '{print $2}' | xargs -L1 docker pull

Upvotes: 0

imjoseangel
imjoseangel

Reputation: 3936

The most "dockerist" way to do it is:

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

Upvotes: 4

Sidahmed
Sidahmed

Reputation: 812

You can use this :

docker images | awk '{print $1":"$2}' | grep -v REPOSITORY | xargs -L1 docker pull 

Upvotes: 4

François Maturel
François Maturel

Reputation: 6162

No, there is no built-in command to pull all docker images at once.

But you can try this (multiline) bash using docker --format :

for image in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep -v '<none>')
do
  docker pull $image
done

Or in one line:

for image in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep -v '<none>'); do docker pull $image; done;

Upvotes: 12

Related Questions