centos 7.5 安装 docker
1.安装依赖
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
2.设置国内镜像源(任选其一)
阿里源
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
清华源
yum-config-manager \
--add-repo \
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
刷新一下
systemctl daemon-reload
3.安装 Docker Engine-Community
yum -y install docker-ce docker-ce-cli containerd.io
安装完成
4.启动docker
systemctl start docker
测试一下
通过运行 hello-world 映像来验证是否正确安装了 Docker
docker run hello-world
5卸载 docker
删除安装包:
yum remove docker-ce
删除镜像、容器、配置文件等内容:
rm -rf /var/lib/docker