您的位置:首页 > 运维架构 > Docker

centos 6.9安装docker操作步骤

2018-03-01 14:56 651 查看
本人是通过在自己电脑安装vmware 后,再进行安装centos 6.9 服务器

vmware可以通过在官网下载版本包进行安装: 
https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/14_0
linux 的IOS镜像文件是通过阿里开源镜像网站获取: http://mirrors.aliyun.com/, 同时也可以通过网易开源镜像网站获取http://mirrors.163.com/

开始进行docker安装

 [root@localhost docker]# yum -y install docker-io

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Install Process

Loading mirror speeds from cached hostfile

 * base: mirrors.zju.edu.cn

 * extras: mirrors.nju.edu.cn

 * updates: mirrors.nju.edu.cn

No package docker-io available.

Error: Nothing to do

执行yum -y install docker-io 发现报错,提示找不到可用安装包, 需要更新第三方软件库

[root@localhost docker]# sudo yum install epel-release

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Install Process

Loading mirror speeds from cached hostfile

 * base: mirrors.zju.edu.cn

 * extras: mirrors.nju.edu.cn

 * updates: mirrors.nju.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package epel-release.noarch 0:6-8 will be installed

--> Finished Dependency Resolution

.................

更新后从新执行yum 安装即可

[root@localhost docker]# yum -y install docker-io

Loaded plugins: fastestmirror, refresh-packagekit, security

Existing lock /var/run/yum.pid: another copy is running as pid 33630.

Another app is currently holding the yum lock; waiting for it to exit...

  The other application is: PackageKit

    Memory :  31 M RSS (348 MB VSZ)

    Started: Thu Mar  1 06:29:40 2018 - 00:17 ago

    State  : Running, pid: 33630

Another app is currently holding the yum lock; waiting for it to exit...

  The other application is: PackageKit

    Memory :  32 M RSS (348 MB VSZ)

............................

启动docker进程

[root@localhost docker]# service docker start 

Starting cgconfig service:                                 [  OK  ]

Starting docker:                                   [  OK  ]

[root@localhost docker]# 

验证是否安装成功,在容器中执行一个测试镜像

[root@localhost docker]# docker run hello-wordl

Unable to find image 'hello-wordl:latest' locally

^C[root@localhost docker]# docker run hello-world

Hello from Docker!

This message shows that your installation appears to be working correctly.

To generate this message, Docker took the fol

检测docker的基本信息

[root@localhost docker]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

hello-world         latest              690d80202531        3 months ago        1.848 kB

[root@localhost docker]# 

[root@localhost docker]# docker version

Client version: 1.7.1

Client API version: 1.19

Go version (client): go1.4.2

Git commit (client): 786b29d/1.7.1

OS/Arch (client): linux/amd64

Server versio
4000
n: 1.7.1

Server API version: 1.19

Go version (server): go1.4.2

Git commit (server): 786b29d/1.7.1

OS/Arch (server): linux/amd64

[root@localhost docker]# 

[root@localhost docker]# docker info

Containers: 3

Images: 2

Storage Driver: devicemapper

 Pool Name: docker-8:2-537520-pool

 Pool Blocksize: 65.54 kB

 Backing Filesystem: extfs

 Data file: /dev/loop0

 Metadata file: /dev/loop1

 Data Space Used: 309.3 MB

 Data Space Total: 107.4 GB

 Data Space Available: 14.69 GB

 Metadata Space Used: 905.2 kB

 Metadata Space Total: 2.147 GB

 Metadata Space Available: 2.147 GB

 Udev Sync Supported: true

 Deferred Removal Enabled: false

 Data loop file: /var/lib/docker/devicemapper/devicemapper/data

 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata

 Library Version: 1.02.117-RHEL6 (2016-12-13)

Execution Driver: native-0.2

Logging Driver: json-file

Kernel Version: 2.6.32-696.el6.x86_64

Operating System: <unknown>

CPUs: 1

Total Memory: 980.6 MiB

Name: localhost.localdomain

ID: JYMN:7V5U:GHX4:JUZI:VEMB:EKNW:PRTL:PPHM:SFRF:Z5OY:UV3O:6IO2

[root@localhost docker]# 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: