官网:https://docs.docker.com/engine/install/centos/
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
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
4.启动Docker$ sudo systemctl start docker
5.通过运行hello-world
映像来验证是否正确安装了Docker Engine 。$ sudo docker run hello-world
docker -version或者docker run hello-world
sudo systemctl enable docker
若要禁用此行为,请disable
改用。
$ sudo systemctl disable docker
8.
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
}
systemctl daemon-reload
systemctl restart docker
sudo groupadd docker
sudo usermod -aG docker your-user
原文:https://www.cnblogs.com/gavin-yao/p/13974294.html