#Docker官方私有仓库registry #官方只提供了API接口,不方便使用,就写了个shell #docker-registry安装配置http://www.cnblogs.com/elvi/p/8384604.html #使用: #复制代码保存为 img_registry.sh # sh img_registry.sh -h #查看帮助 #shell代码 git地址https://gitee.com/almi/docker/blob/master/0.Shell/img_registry.sh #!/bin/bash #cnetos7,docker-ce v17.12.0,registry v2.6.2 #Docker registry 私有仓库镜像查询、删除、上传、下载 #Author Elven <elven89@qq.com> #Blog http://www.cnblogs.com/elvi/p/8384675.html #root [[ $UID -ne 0 ]] && { echo "Run in root user !";exit; } #need jq ,get json data [[ -f /usr/bin/jq ]] || { echo 'install jq';yum install -y jq &>/dev/null; } #参数 variable #registry容器名称,默认registry RN=${RN:-registry} #访问网址,默认localhost:5000 HUB=${HUB:-localhost:5000} HUB=hub.test.com:5000 #检测 check function Check_hub() { [[ `curl -s $HUB/v2/_catalog` == "Failed connect" ]] && { echo -e "