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
国内阿里数据源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io -y
systemctl enable docker
systemctl start docker
查看docker版本
docker --version
启动docker服务
systemctl start docker
查看docker服务运行状态
$ systemctl status docker
运行docker容器
docker run
设置docker开机启动
systemctl enable docker.service
docker images
官方新命令
docker image ls
docker run hello-world
docker ps -a
官方新命令
docker container ls --all