CentOS 8 安装Docker
一、安装docker
1. 下载docker-ce的repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
2. 安装依赖
yum -y install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
3. 安装docker-ce
dnf -y install docker-ce docker-ce-cli --nobest
4.启动 docker
systemctl start docker
5.查看 docker 版本信息
docker -v
6.设置开机自动启动
systemctl enable --now docker
二、docker 命令
1.查看镜像列表:
docker images
2.查看容器列表
docker ps -a
三、测试
1.拉取hello-world镜像
docker pull hello-world
2.运行hello-world
docker run hello-world