type
status
date
slug
summary
tags
category
icon
password

使用RMP仓库安装

在主机上首次安装Docker前, 你需要设置Docker仓库。然后, 你就可以在仓库里安装和更新Docker了

建立仓库

安装yum-utils 包 (该包提供 yum-config-manager 的集成环境) 并且设置仓库.

安装Docker引擎

1、安装Docker Engine, containerd和 Docker Compose:

  • 最新版
  • 指定历史版本
运行以下代码可以安装最新版Docker引擎
如果运行代码后提示你要同意GPG key,如果确定指纹符与以下数据匹配就确定同意它,数据: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
此命令只是安装了Docker,不会启动Docker。同时,此命令也创建了一个docker组,但是,它不会默认添加任何用户到这个组中。

2、启动Docker

运行以下命令,启动docker

3、运行hello-word镜像以验证docker成功安装。

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
此命令下载了一个测试镜像并且在一个容器上运行该镜像。当容器成功运行,终端会提示一个成功运行的信息,看到Hello from Docker!的话,说明镜像成功运行啦,docker成功安装~
注意运行测试镜像之前,需先启动docker,否则会出现以下运行失败提示。只需要先执行sudo systemctl start docker,在继续运行镜像就能成功。
Gus7i
Gus7i
Just for fun
公告
type
status
date
slug
summary
tags
category
icon
password
keep thinkinnnnnng
notion image