Docker 镜像批量操作命令

批量修改镜像的repository:
docker images|grep harbor.123.cn|awk '{print $1":"$2}'|while read image; do new_images=$(echo $image|sed s#harbor.8531.cn#harbor-new.123.cn#g); docker tag $image $new_images; done

批量推送镜像:
docker images |grep "harbor-new.123.cn" |awk '{print $1":"$2}'|xargs -i docker push {} &

强制批量删除images:
docker rmi -f $(docker images|grep harbor-new.123.cn |awk '{print $3}')

你可能感兴趣的:(docker,docker,运维,容器)