码迷,mamicode.com
首页 > 其他好文 > 详细

docker安装

时间:2017-05-18 09:45:45      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:art   输出   enable   centos   sof   images   ges   host   highlight   

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  \\显示正在运行容器

docker安装

标签:art   输出   enable   centos   sof   images   ges   host   highlight   

原文地址:http://www.cnblogs.com/linuxws/p/6871642.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!