linux-安装Docker

linux-安装Docker

1、安装前的清理:

                  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、设置阿里云镜像(可在阿里云中找到自己的镜像加速服务)

[root@localhost ~]# sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker

4、安装 Docker:

sudo yum install -y docker-ce docker-ce-cli containerd.io --nobest

5、启动 Docker:

systemctl enable docker.service

6、设置开机启动:

systemctl start docker.service

Copyright: 采用 知识共享署名4.0 国际许可协议进行许可

Links: https://qingjiaqi.com/archives/linux-安装docker

Buy me a cup of coffee ☕.