docker 安装

1、查看系统上是否已安装docker

yum list installed | grep docker

# 如果有卸载docker
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

2、安装依赖

sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

3、设置yum源

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

4、安装最新版docker

sudo yum -y install docker-ce

5、查看docker信息或者版本

docker info

docker version

6、安装docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

centos8安装

  • CentOS8安装Docker出现 package docker-ce-3:19.03.12-3.el7.x86_64 requires containerd.io >= 1.2.2-3
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
yum install -y yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum install -y docker-ce 
//启动docker
systemctl start docker
//添加开机启动
systemctl enable docker
posted @ 2021-01-05 15:03  believexin  阅读(55)  评论(0编辑  收藏  举报