1、进入虚拟机:vagrant ssh
2、docker安装文档:https://docs.docker.com/engine/install/centos/
3、安装步骤
3.1)卸载系统之前的 docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
3.2)安装yum utils包,并设置存储库
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3.3)安装 docker,以及 docker-cli
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
3.4)启动docker
sudo systemctl start docker
3.5)设置docker开机自动启动
sudo systemctl enable docker
3.6)配置docker阿里镜像加速器
3.6.1)
sudo mkdir -p /etc/docker
3.6.2)
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://9bt3rat6.mirror.aliyuncs.com"]
}
EOF
3.6.3)
sudo systemctl daemon-reload
3.6.4)
sudo systemctl restart docker
标签:虚拟机,sudo,ce,yum,docker,随笔,安装
From: https://www.cnblogs.com/xiaonuanxin/p/17011848.html