1、拉取私服镜像
docker pull registry
2、启动私服
docker run -d -p 5000:5000 -v /mtn/docker/registry:/var/lib/registry registry
3、查看私服状态
netstat -an | grep 5000
tcp6 0 0 :::5000 :::* LISTEN
4、设置tag,推送到本地私服
docker tag ubuntu:latest localhost:5000/ubuntu:latest
5、推送镜像到本地私服
docker push localhost:5000/ubuntu:latest
6、查看本地私服镜像
curl http://localhost:5000/v2/_catalog
{"repositories":["ubuntu"]}
7、删除对应镜像,测试从本地私服拉取镜像
docker image rm localhost:5000/ubuntu
docker pull localhost:5000/ubuntu
docker images