1、拉取registry镜像:
docker pull registry
2、运行registry容器:
docker run -d -p 5000:5000 -v /mnt/date/registry:/var/lib/registry registry
-v把registry的镜像路径/var/lib/registry映射到本机的/mnt/date/registry
3、需要拉取registry里面镜像的主机需要配置:
* 配置http请求镜像拉取:
echo '{ "insecure-registries":["xxx.xxx.xxx.xxx:5000"] }' > /etc/docker/daemon.json
* 重启docker服务:
systemctl restart docker
4、镜像打包提交过程:
1、给镜像打tag:
例如:docker tag busybox 10.100.50.120:5000/busybox:v1803.2
2、提交镜像:
例如:docker push 10.100.50.120:5000/busybox:v1803.2
3、拉取镜像:
例如:docker pull 10.100.50.120:5000/busybox:v1803.2
5、相关命令:
1、查询registry中已有的镜像:
curl -X GET http://192.168.1.8:5000/v2/_catalog
2、获取某个镜像的标签列表:
curl -X GET http://192.168.1.8:5000/v2/image_name/tags/list
网友评论