centos8安装docker环境

  • 安装yum-utils:
yum install -y yum-utils device-mapper-persistent-data lvm2
  • 为yum源添加docker仓库位置:
 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  • 安装docker:
yum install docker-ce

如果安装报错

Error:
Problem: package docker-ce-3:19.03.5-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed

则需要先安装containerd.io依赖:

yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
  • 启动docker:
systemctl start docker
  • 设置开机启动:
systemctl enable docker
  • 测试docker:
docker version

输出部分信息如下:

Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:25:41 2019
OS/Arch: linux/amd64
Experimental: false

  • docker安装成功

你可能感兴趣的:(docker)