shell

搭建私有镜像和获取镜像仓库和仓库版本了

下载registry镜像并启动
# docker pull registry
# docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry
测试,查看镜像仓库中所有镜像
# curl http://192.168.199.205:5000/v2/_catalog
{"repositories":[]}
配置私有仓库可信任
# vi /etc/docker/daemon.json
{"insecure-registries":["192.168.199.205:5000"]}
# service docker restart
打标签
# docker tag centos:6 192.168.1.120:5000/centos:6
上传
# docker push 192.168.1.120:5000/centos:6
下载
# docker pull 192.168.1.120:5000/centos:6
列出镜像标签
# curl http://192.168.1.120:5000/v2/centos/tags/list


docker tag 192.168.199.205/redis:2 192.168.199.205:5000/redis:2
docker tag 192.168.199.205/redis:3 192.168.199.205:5000/redis:3
docker tag 192.168.199.205/redis:4 192.168.199.205:5000/redis:4
docker tag 192.168.199.205/redis:4 192.168.199.205:5000/mysql:6
docker tag 192.168.199.205/redis:6 192.168.199.205:5000/mysql:7
docker tag 192.168.199.205/redis:5 192.168.199.205:5000/mysql:7

docker push 192.168.199.205:5000/mysql
docker push 192.168.199.205:5000/redis
root@aelf-To-be-filled-by-O-E-M:~# curl http://192.168.199.205:5000/v2/_catalog
{"repositories":["mysql","redis"]}
root@aelf-To-be-filled-by-O-E-M:~# curl http://192.168.199.205:5000/v2/mysql/tags/list
{"name":"mysql","tags":["7","5","6"]}
root@aelf-To-be-filled-by-O-E-M:~# curl http://192.168.199.205:5000/v2/redis/tags/list
{"name":"redis","tags":["4","5","3"]}
root@aelf-To-be-filled-by-O-E-M:~#

posted @ 2019-05-29 10:51  devops运维  阅读(552)  评论(0编辑  收藏  举报
python