Docker 软件包在CentOS-Extras 软件源里,所以咱们用yum 命令安装docker即可。
[root@localhost ~]# yum install docker [root@localhost ~]# docker version \\查看docker版本
创建一个 Docker 容器
[root@localhost ~]# docker run -i -t centos /bin/bash \\-i 捕获标准输入输出” “-t 分配一个终端或控制台”。
启动 Docker 服务
[root@localhost ~]# systemctl start docker.service \\启动 docker 服务 [root@localhost ~]# systemctl enable docker.service \\开机启动
搜索查找镜像:
[root@localhost ~]# docker search centos
下载官方的 CentOS 镜像到本地
[root@localhost ~]# docker pull centos
确认 CentOS 镜像已经被获取
[root@localhost ~]# docker images
[root@cd05639b3f5c /]# exit \\断开与容器的连接 exit [root@localhost ~]# docker ps \\显示正在运行容器
原文:http://www.cnblogs.com/linuxws/p/6871642.html