1肥缔、查看內(nèi)核版本,Docker 要求 CentOS 系統(tǒng)的內(nèi)核版本高于 3.10,否則就升級(jí)內(nèi)核
[root@localhost ~]# uname -r
3.10.0-862.el7.x86_64
2、確保yum包更新到最新
[root@localhost ~]# yum update
3、安裝依賴
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
4霞扬、設(shè)置yum源
[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
5佑笋、安裝docker
[root@localhost ~]# yum install docker-ce
6翼闹、啟動(dòng)docker
[root@localhost ~]# systemctl start docker
7、加入開機(jī)啟動(dòng)項(xiàng)
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
8蒋纬、驗(yàn)證docker是否安裝成功
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# docker version
Client:
Version:? ? ? 18.03.1-ce
API version:? 1.37
Go version:? go1.9.5
Git commit:? 9ee9f40
Built:? ? ? ? Thu Apr 26 07:20:16 2018
OS/Arch:? ? ? linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
? Version:? ? ? 18.03.1-ce
? API version:? 1.37 (minimum version 1.12)
? Go version:? go1.9.5
? Git commit:? 9ee9f40
? Built:? ? ? ? Thu Apr 26 07:23:58 2018
? OS/Arch:? ? ? linux/amd64
? Experimental: false
[root@localhost ~]#