晦涩de咚 2018-08-08 12:38:58 112次浏览 0条回复 0 0 0
docker 系统版本要求 **64-bit 系统 kernel 3.10+** 

1.检查内核版本

uname -r

2.确保yum是最新的

yum update

3.添加 yum 仓库

tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

4.安装 Docker

yum install -y docker-engine

5.启动docker

systemctl start docker.service

6.验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

docker version
---------------------------------------
结果:
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:25 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:25 2017
 OS/Arch:      linux/amd64
 Experimental: false

7.设置开机自启动

sudo systemctl enable docker
------------------------------------------
结果:
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册