docker 批量更改镜像标签
过滤出需要更改标签的镜像sed 's/registry.aliyuncs.com\/google_containers/registry.k8s.io/': 列出镜像grep "registry.aliyuncs.com\/google_containers": 替换原标签awk '{print "docker tag "$3" "$1":"$2""}': 打印更改标签命令bash。: 将输出的命
·
批量更改镜像标签
docker images | grep "registry.aliyuncs.com\/google_containers" | sed 's/registry.aliyuncs.com\/google_containers/registry.k8s.io/' | awk '{print "docker tag "$3" "$1":"$2""}' | bash
docker images
: 列出镜像
grep "registry.aliyuncs.com\/google_containers"
: 过滤出需要更改标签的镜像
sed 's/registry.aliyuncs.com\/google_containers/registry.k8s.io/'
: 替换原标签
awk '{print "docker tag "$3" "$1":"$2""}'
: 打印更改标签命令
bash
: 将输出的命令执行
批量删除镜像
docker images | grep "registry.k8s.io" | awk '{print "docker rmi "$1":"$2""}' | bash
更多推荐
已为社区贡献3条内容
所有评论(0)