centos7.5安装docker
1.更新yum
yum update
2.安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
yum install -y yum-utils device-mapper-persistent-data lvm2
3.设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.安装Docker
docker-ce-17.12.1.ce是作者选择的版本。
yum install docker-ce-17.12.1.ce
5.启动Docker,命令:systemctl start docker,然后加入开机启动,如下
systemctl start docker
systemctl enable docker
6.验证安装是否成功
docker version
安装成功如下
Client: Version: 17.12.1-ce API version: 1.35 Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:15:20 2018 OS/Arch: linux/amd64 Server: Engine: Version: 17.12.1-ce API version: 1.35 (minimum version 1.12) Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:17:54 2018 OS/Arch: linux/amd64 Experimental: false