CentOS 安装docker

1. 旧版本删除

yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine \ docker-ce

2. 设置仓库

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

 

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

3. 安装

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

4. 启动

sudo systemctl start docker

重启:systemctl restart docker / service docker restart

关闭:docker service docker stop / docker systemctl stop docker

posted @ 2022-10-22 12:58  从零开始的0  阅读(19)  评论(0编辑  收藏  举报