1、下载docker ,下载地址https://docs.docker.com/engine/install/centos/
2、卸载旧的docker,
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
3、
Set up the repository
Install the yum-utils
package (which provides the yum-config-manager
utility) and set up the repository.
sudo yum install -y yum-utils sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
替换成阿里云镜像
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4、安装镜像
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
5、启动docker
sudo systemctl start docker
6、检查版本
docker version
7、运行镜像
sudo docker run hello-world
8、设置阿里云镜像加速器
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://5yfoi1k1.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
标签:第一篇,sudo,ce,repo,yum,Linux,docker,com From: https://www.cnblogs.com/topguntopgun/p/16618135.html