1.官网
官方文档
Docker Hub官网 镜像

2.Docker 的三要素
1、镜像

2、容器

3、仓库

小总结
3.Docker 平台架构图 (架构版本)


4.安装Docker
1.确定你是CentOS7及以上版本
2.卸载旧版本
3.yum安装 gcc 相关
因为gcc 是某些软件的编译工具 ,可能会用到它的环境,避免安装失败,所以装一下
各种Linux的基础构建包,很多软件依赖于它,所以安装一下
出现镜像无法抵达,请前往 以下网址 解决
Linux 安装 与 Docker 安装 配置镜像_linux docker 镜像-CSDN博客
1.保证能上外网
2.安装gcc
cpp
yum -y install gcc
3.安装gcc-c++
bash
yum -y install gcc-c++
4.安装dnf
bash
yum -y install dnf

设置存储库
bash
sudo dnf -y install dnf-plugins-core
bash
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf-plugins-core 配置管理的一个工具类
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
设置stable镜像仓库
这好像说centos9这么操作,但是我们是7 所以降回去
不要调用这个!!!!!!!
5.yum安装配置管理工具类和stable镜像仓库
bash
yum install -y yum-utils
配置阿里云镜像源
bash
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo vim /etc/yum.repos.d/docker-ce.repo 会在这个路径创建 docker-ce.repo 若配置错了,直接删除,重新执行add就好了
或者
bash
sudo yum-config-manager --remove docker-ce
删除仓库的配置文件也可以!!!!!!!!!
重建一下yum的索引
bash
sudo yum clean all
bash
yum makecache fast
执行它会快一点 构建元数据缓存
fast
模式不会重新下载所有仓库的完整元数据,而是尽可能复用已经缓存的数据
如果为了稳定,就执行 sudo yum makecache 就可以了
yum makecache
命令用于更新本地的 yum 缓存,以便更快地查找和安装软件包。yum makecache fast
是 yum makecache
的一个子选项,它们之间的区别主要体现在缓存更新方式上
6.安装Docker最新版
bash
sudo yum -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
7.开机自启docker
bash
sudo systemctl enable --now docker
8.启动HelloWorld
bash
sudo docker run hello-world

安装还得按照我之前整理的那一套 唉~
4.卸载
bash
systemctl stop docker
bash
sudo yum -y remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
bash
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
想重新下回来,就按照上面的做就好了