centos 下docker 安装方法

这里只介绍比较简易的安装方式:

一、使用yum安装

最好更新一下yum

sudo yum update

直接安装

sudo yum install -y docker

此方法最简单,但是版本比较老:

sudo docker version
Client:
 Version:     1.13.1
 API version:   1.26
 Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64
 Go version:   go1.9.4
 Git commit:   8633870/1.13.1
 Built:      Fri Sep 28 19:45:08 2018
 OS/Arch:     linux/amd64

Server:
 Version:     1.13.1
 API version:   1.26 (minimum version 1.12)
 Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64
 Go version:   go1.9.4
 Git commit:   8633870/1.13.1
 Built:      Fri Sep 28 19:45:08 2018
 OS/Arch:     linux/amd64
 Experimental:  false

二、使用脚本安装

docker有提供脚本供我们安装docker社区维护的最新版本的docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

脚本会自动获取docker.repo并安装。

docker version
Client:
 Version:      18.06.1-ce
 API version:    1.38
 Go version:    go1.10.3
 Git commit:    e68fc7a
 Built:       Tue Aug 21 17:23:03 2018
 OS/Arch:      linux/amd64
 Experimental:   false
Server:
 Engine:
 Version:     18.06.1-ce
 API version:   1.38 (minimum version 1.12)
 Go version:    go1.10.3
 Git commit:    e68fc7a
 Built:      Tue Aug 21 17:25:29 2018
 OS/Arch:     linux/amd64
 Experimental:   false

总结

相关推荐