0%

Docker安装教程

在Rocky Linux 9上安装Docker

添加docker repo, 更新源, 安装docker-ce

1
2
3
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf update
dnf install -y docker-ce

启动docker

1
2
systemctl daemon-reload
systemctl start docker

查看docker版本

1
2
3
docker version
Client: Docker Engine - Community
Version: 27.3.1

下载镜像

1
docker pull rockylinux:9.3

在Centos7上安装Docker

移除旧版本Docker

1
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

安装依赖

1
yum install -y yum-utils device-mapper-persistent-data lvm2

添加Docker存储库

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

安装Docker

1
yum install -y docker-ce docker-ce-cli containerd.io

启动Docker服务

1
systemctl start docker

查看Docker版本

1
2
docker --version
Docker version 25.0.2, build 29cf629

参考

https://www.rockylinux.cn/notes/zai-rocky-linux-9-1-shang-an-zhuang-docker-ce.html