RHEL8安装docker

发布时间 2024-01-09 11:13:40作者: 李济宏(Amadeus)

1,安装yum-utils和dnf-utils

yum install -y yum-utils dnf-utils

2,添加源

docker官方源

yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo

添加docker-ce的软件仓库(国内源)

dnf config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

查看repolist中docker-ce仓库是否添加成功

yum repolist

3,安装docker

yum -y install docker-ce docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --allowerasing

开机自启动并现在启动docker服务

systemctl enable --now docker

查看docker版本

docker --version