Docker实践(1) -- 安装Docker

1、支持的CentOS版本:

    CentOS 7(64-bit),内核版本为3.10以上。

    CentOS 6.5(64-bit)或更高版本,系统内核版本为2.6.32-431或者更高版本。


2、安装Docker:

    以下是在Centos 7上的安装步骤。

[root@test1 ~]# cat /proc/version
Linux version 3.10.0-862.11.6.el7.x86_64
[root@test1 ~]# yum -y install wget
[root@test1 ~]# cd /etc/yum.repos.d/
[root@test1 yum.repos.d]# mv *.repo repo.bak/
[root@test1 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@test1 yum.repos.d]# yum clean all
[root@test1 yum.repos.d]# yum makecache
[root@test1 yum.repos.d]# yum list | grep epel-release
[root@test1 yum.repos.d]# yum -y install epel-release
[root@test1 yum.repos.d]# yum upgrade
[root@test1 yum.repos.d]# yum -y install docker
[root@test1 yum.repos.d]# service docker start

    或者,通过脚本安装:

# curl -fsSL https://get.docker.com/ | sh     ---- 执行这个脚本会添加docker.repo源,并安装docker
# service docker start


3、测试安装是否成功:

# docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.


猜你喜欢

转载自blog.51cto.com/13568014/2298888