在CentOS上搭建docker私服
环境:
IP:
0.0.0.50(Docker Registry Server)
0.0.0.59(Docker client )OS: CentOS Linux release 7.2.1511 (Core)
Docker Version: Docker version 1.12.0, build 8eab29e
Step 1: 以下操作运行在0.0.0.50(Docker Registry Server)上
安装docker-registry, 运行以下命令
docker run -d -e SETTINGS_FLAVOR=dev -e STORAGE_PATH=/tmp/registry -v /opt/data/registry:/tmp/registry -p 5000:5000 registry
安装,启动好之后,运行访问这个URL来验证是否成功:
[root@ct7 system]# curl http://0.0.0.50:5000/v1/_ping 404 page not found
如果有如下返回值则代表成功,无返回则说明进程没有启动,把所有的container都删除然后在重新启动
docker rm $(docker ps -a -q)
docker run -d -e SETTINGS_FLAVOR=dev -e STORAGE_PATH=/tmp/registry -v /opt/data/registry:/tmp/registry -p 5000:5000 registry
Step 2: 以下操作运行在0.0.0.59(Docker client)上
1.查看当前的images
|
|
2.查看当前所有的container
|
|
3.查看当前运行的container
|
|
4.Create a new image from a container’s changes
|
|
5.push new image into docker private registry
|
|
6.verify the new image from docker private registry
|
|