安装前菜--如何卸载Docker
1.查询docker安装包
yum list installed | grep docker
2.删除安装包
yum remove docker*
3.删除镜像/容器等
rm -rf /var/lib/docker
下面是详细的安装教程------------------------------------华丽的分割线---------------------------------------------
1.安装依赖工具包
yum install -y yum-utils device-mapper-persistent-data lvm2
2.设置镜像仓库(阿里镜像仓库)
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.更新yum软件包索引
yum makecache fast
4.安装docker-ce(社区版-免费的)
yum install docker-ce docker-ce-cli containerd.io
5.查看docker版本,是否安装成功
docker --version
6.启动docker容器
systemctl start docker
顺便补充以下常用命令:
重启docker
systemctl restart docker
停止docker
systemctl stop docker
7.查看启动状态
systemctl status docker
8.查看镜像
docker images
9.镜像仓库搜索需要的镜像(拿hello-world举例)
docker search hello-world
10.找到之后拉取镜像
docker pull hello-world
11.拉取下来之后运行hello-world镜像
docker run hello-world
12.查看所有容器(运行的和未运行的)
docker ps -a