docker官网
https://www.docker.com/
docker支持多环境,linux\mac\windows,根据需要选取
linux下docker支持情况:

image.png
centos上安装docker
卸载旧版docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
使用repository安装
其他安装方式详见官网:https://docs.docker.com/engine/install/centos/
设置仓库
Install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Enable the nightly or test repositories.
sudo yum-config-manager --enable docker-ce-nightly
sudo yum-config-manager --enable docker-ce-test
安装docker
#安装docker最新版本
sudo yum install docker-ce docker-ce-cli containerd.io
#查看docker版本列表
yum list docker-ce --showduplicates | sort -r
#安装指定版本docker
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
启动docker
sudo systemctl start docker
run helloworld 验证docker安装完成
sudo docker run hello-world
卸载docker
1. Uninstall the Docker Engine, CLI, and Containerd packages:
sudo yum remove docker-ce docker-ce-cli containerd.io
2. Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd