01. 入门 安装
1. 安装⚓
1.1 卸载之前的版本⚓
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
1.2 安装 Docker CE⚓
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum install docker-ce docker-ce-cli containerd.io
$ sudo systemctl start docker
2. 安装检查⚓
$ sudo docker run hello-world
3. 卸载 Docker CE⚓
$ sudo yum remove docker-ce
# 删除数据
$ sudo rm -rf /var/lib/docker
还需要手动地删除编辑过的配置文件。
4. 常用命令⚓
## List Docker CLI commands
docker
docker container --help
## Display Docker version and info
docker --version
docker version
docker info
## Execute Docker image
docker run hello-world
## List Docker images
docker image ls
## List Docker containers (running, all, all in quiet mode)
docker container ls
docker container ls --all
docker container ls -aq