代码改变世界

docker 镜像批量操作相关命令

2020-10-05 22:37  dribs  阅读(666)  评论(0编辑  收藏  举报

1、批量下载目录里save出来tar

wget -r -p -k -np http://opansible0001.xxx.io/harddisk1/

  

2、批量docker load 进去把tar

for i in `ls`;do docker load -i $i;done

  

3、批量修改tag,docker tag

docker images | grep xxx| sed 's/xxx/XXX/g' | awk '{print "docker tag"" " $3" "$1":"$2}' | sh

  

4、批量上传docker push

nohup docker images | grep "XXXX" |awk '{print "docker push"" "$1":"$2}'  |sh > a.log &

 

5、批量删除load的镜像

 docker images | grep -v "v1.10.3" | awk '{print $3}' | xargs docker rmi -f