docker仓库迁移脚本
2019-07-25 本文已影响0人
zwb_jianshu
bach_qianyi.sh
#!/bin/bash
for i in `curl http://10.0.0.12:5000/v2/_catalog 2>/dev/null|jq '.repositories[]'|tr '"' '\0'`
do
for j in `curl http://10.0.0.12:5000/v2/${i}/tags/list 2>/dev/null|jq '.tags[]'|tr '"' '\0'`
do
docker pull 10.0.0.12:5000/${i}:${j}
docker tag 10.0.0.12:5000/${i}:${j} blog.qstack.com.cn/zwb-test/${i}:${j}
docker push blog.qstack.com.cn/zeb-test/${i}:${j}
done
done