[root@centos7 ~]# docker pull 10.0.0.5:5000/lcentos
[root@centos7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
10.0.0.5:5000/ssh latest ad6a3ff29626 4 weeks ago 396.7 MB
10.0.0.5:5000/lcentos latest 67591570dd29 12 weeks ago 191.8 MB
[root@centos7 ~]#
6、创建并运行一个容器
[root@centos7 ~]# docker run -d -it --privileged=false -p 80:80 --name abccentos 10.0.0.5:5000/lcentos /bin/bash
15b9f42b3d63846085664139bff0c041f614bc2b717787686d23785d98b37160
[root@centos7 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
15b9f42b3d63 10.0.0.5:5000/lcentos "/bin/bash" 16 seconds ago Up 13 seconds 0.0.0.0:80->80/tcp abccentos
[root@centos7 ~]#
7、进入容器查看,可以看到centos的版本等信息
[root@centos7 ~]# docker attach 15b9f42b3d63
[root@15b9f42b3d63 /]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@15b9f42b3d63 /]# uname -r
3.10.0-327.el7.x86_64
[root@15b9f42b3d63 /]# uname -a
Linux 15b9f42b3d63 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@15b9f42b3d63 /]#
以上就是整个创建私有镜像库的过程,欢迎一起交流学习。
更多Docker相关教程见以下内容:
Ubuntu 14.04安装Docker
在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker