简体   繁体   中英

Update (pull) all docker images at once

是否有命令可以在终端中一次更新(拉取)所有下载的 Docker 镜像?

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;

你可以使用这个:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM