如何一次从 docker repo 中提取所有 docker 容器映像? [英] How to Pull all docker container images from docker repo at once?

查看:17
本文介绍了如何一次从 docker repo 中提取所有 docker 容器映像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个私人 docker 存储库,其中存储了 10 个容器映像.我想将所有图像拉到一台机器上.有没有一种方法可以使用单个命令从存储库中提取所有图像?一些命令,如

I have a private docker repo in which i have 10 container images stored. I want to pull all images to a machine. is there a way i can pull all images from a repo with a single command? some command like

docker pull  xx.xx.com/reponame/* 

在研究过程中,我找到了提取单个图像的所有标签的方法;但到目前为止所有图像都没有运气

while researching I found ways to pull all tags of a single image; but no luck so far on all images

推荐答案

试试这个(它会更新没有直接附加运行容器的图像)

Try this (it will update images that does not have running containers directly attached to them)

docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -L1 docker pull

先试试这条线,看看会覆盖哪些图像:

Try out this line out first to see what images will be covered:

docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}'

这篇关于如何一次从 docker repo 中提取所有 docker 容器映像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆