Docker安裝指南 (CentOS)
1. 卸載舊版Docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2. 設(shè)置Docker的YUM源(二選一)
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
如果不想阿里云的源堂污,也可用官方源(可能遇到網(wǎng)絡(luò)問題)
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3.安裝docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4.啟動(dòng)docker
sudo systemctl start docker
5.設(shè)置開機(jī)自啟動(dòng)
sudo systemctl enable docker
6.查看版本
docker -v
docker info