Docker私有镜像仓库
使用阿里云加速:
tee /etc/docker/daemon.json << 'EOF' { "registry-mirrors": [ "https://ie57kmv1.mirror.aliyuncs.com" ] } EOF
1、下载registry镜像
docker pull registry
2、启动registry容器
docker run -d --name registry --restart=unless-stopped -p 5000:5000 -v /data/registry:/var/lib/registry registry
3、解决 http: server gave HTTP response to HTTPS client问题
编辑 vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --insecure-registry harbor.td-k8s.com
然后重启:
systemctl daemon-reload && systemctl restart docker
4、拉取测试镜像
docker pull busybox
5、测试镜像打标签
docker tag busybox 10.100.11.93:5000/test:01 ---不能有大写字母
6、上传到本地仓库
docker push 10.100.11.93:5000/test:01
7、删除本地镜像
docker rmi 10.100.11.93:5000/test:01
8、通过http api访问下
#curl 10.100.11.93:5000/v2/_catalog
{"repositories":["test"]}
# curl 10.100.11.93:5000/v2/test/tags/list
{"name":"test","tags":["01"]}
9、拉取到本地
docker pull 10.100.11.93:5000/test:01
10、验证
# docker images
11、私有仓库图形管理界面
docker pull parabuzzle/craneoperator docker run -d --restart=unless-stopped -p 81:80 -e REGISTRY_HOST=10.100.11.93 -e REGISTRY_PORT=5000 -e REGISTRY_PROTOCOL=http -e SSL_VERIFY=false -e ALLOW_REGISTRY_LOGIN=true -e REGISTRY_ALLOW_DELETE=true parabuzzle/craneoperator:latest
访问:10.100.11.93:81