当前位置: 首页 > news >正文

Rocky Linux 系统安装/部署 Docker

1、下载docker-ce的repo文件

[root@localhost ~]# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1919  100  1919    0     0   2635      0 --:--:-- --:--:-- --:--:--  2635

2、安装docker

[root@localhost ~]# yum install docker-ce -y
Docker CE Stable - x86_64                                                                                   44 kB/s |  59 kB     00:01
Rocky Linux 9 - BaseOS                                                                                     1.8 MB/s | 2.3 MB     00:01
Rocky Linux 9 - AppStream                                                                                  5.3 MB/s | 8.3 MB     00:01
Rocky Linux 9 - Extras                                                                                      13 kB/s |  15 kB     00:01
依赖关系解决。
===========================================================================================================================================
 软件包                                    架构                   版本                              仓库                              大小
===========================================================================================================================================
安装:
 docker-ce                                 x86_64                 3:27.3.1-1.el9                    docker-ce-stable                  27 M
安装依赖关系:
 containerd.io                             x86_64                 1.7.23-3.1.el9                    docker-ce-stable                  43 M
 docker-ce-cli                             x86_64                 1:27.3.1-1.el9                    docker-ce-stable                 8.0 M
安装弱的依赖:
 docker-buildx-plugin                      x86_64                 0.17.1-1.el9                      docker-ce-stable                  14 M
 docker-ce-rootless-extras                 x86_64                 27.3.1-1.el9                      docker-ce-stable                 4.4 M
 docker-compose-plugin                     x86_64                 2.29.7-1.el9                      docker-ce-stable                  13 M

事务概要
===========================================================================================================================================
安装  6 软件包

总下载:109 M
安装大小:426 M
下载软件包:
(1/6): docker-ce-27.3.1-1.el9.x86_64.rpm                                                                   6.1 MB/s |  27 MB     00:04
(2/6): docker-buildx-plugin-0.17.1-1.el9.x86_64.rpm                                                        2.3 MB/s |  14 MB     00:05
(3/6): docker-ce-rootless-extras-27.3.1-1.el9.x86_64.rpm                                                   1.6 MB/s | 4.4 MB     00:02
(4/6): docker-ce-cli-27.3.1-1.el9.x86_64.rpm                                                               1.6 MB/s | 8.0 MB     00:05
(5/6): docker-compose-plugin-2.29.7-1.el9.x86_64.rpm                                                       3.2 MB/s |  13 MB     00:04
(6/6): containerd.io-1.7.23-3.1.el9.x86_64.rpm                                                             3.2 MB/s |  43 MB     00:13
-------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                       8.2 MB/s | 109 MB     00:13
Docker CE Stable - x86_64                                                                                  2.4 kB/s | 1.6 kB     00:00
导入 GPG 公钥 0x621E9F35:
 Userid: "Docker Release (CE rpm) <docker@docker.com>"
 指纹: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
 来自: https://download.docker.com/linux/centos/gpg
导入公钥成功
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                            1/1
  安装    : docker-compose-plugin-2.29.7-1.el9.x86_64                                                                                  1/6
  运行脚本: docker-compose-plugin-2.29.7-1.el9.x86_64                                                                                  1/6
  安装    : docker-buildx-plugin-0.17.1-1.el9.x86_64                                                                                   2/6
  运行脚本: docker-buildx-plugin-0.17.1-1.el9.x86_64                                                                                   2/6
  安装    : docker-ce-cli-1:27.3.1-1.el9.x86_64                                                                                        3/6
  运行脚本: docker-ce-cli-1:27.3.1-1.el9.x86_64                                                                                        3/6
  安装    : containerd.io-1.7.23-3.1.el9.x86_64                                                                                        4/6
  运行脚本: containerd.io-1.7.23-3.1.el9.x86_64                                                                                        4/6
  安装    : docker-ce-rootless-extras-27.3.1-1.el9.x86_64                                                                              5/6
  运行脚本: docker-ce-rootless-extras-27.3.1-1.el9.x86_64                                                                              5/6
  安装    : docker-ce-3:27.3.1-1.el9.x86_64                                                                                            6/6
  运行脚本: docker-ce-3:27.3.1-1.el9.x86_64                                                                                            6/6
  验证    : containerd.io-1.7.23-3.1.el9.x86_64                                                                                        1/6
  验证    : docker-buildx-plugin-0.17.1-1.el9.x86_64                                                                                   2/6
  验证    : docker-ce-3:27.3.1-1.el9.x86_64                                                                                            3/6
  验证    : docker-ce-cli-1:27.3.1-1.el9.x86_64                                                                                        4/6
  验证    : docker-ce-rootless-extras-27.3.1-1.el9.x86_64                                                                              5/6
  验证    : docker-compose-plugin-2.29.7-1.el9.x86_64                                                                                  6/6

已安装:
  containerd.io-1.7.23-3.1.el9.x86_64     docker-buildx-plugin-0.17.1-1.el9.x86_64          docker-ce-3:27.3.1-1.el9.x86_64
  docker-ce-cli-1:27.3.1-1.el9.x86_64     docker-ce-rootless-extras-27.3.1-1.el9.x86_64     docker-compose-plugin-2.29.7-1.el9.x86_64

完毕!

3、启动docker


[root@localhost ~]# docker -v && systemctl restart docker && systemctl enable docker
Docker version 27.3.1, build ce12230
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.



4、运行/拉取镜像测试


[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:305243c734571da2d100c8c8b3c3167a098cab6049c9a5b066b6021a60fcb966
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

http://www.lryc.cn/news/490169.html

相关文章:

  • 12 —— Webpack中向前端注入环境变量
  • uniapp接入BMapGL百度地图
  • 外卖系统开发实战:从架构设计到代码实现
  • 神经网络反向传播算法公式推导
  • Spark SQL 之 QueryStage
  • 【shodan】(三)vnc漏洞利用
  • 每日OJ_牛客_游游的字母串_枚举_C++_Java
  • 51c深度学习~合集8
  • 嵌入式:Flash的分类以及Jlink/J-flash的编程支持
  • 【爬虫】Firecrawl对京东热卖网信息爬取(仅供学习)
  • 遗传算法(Genetic Algorithm, GA)
  • 【二分答案+倍增快速幂】课堂练习
  • LeetCode 力扣 热题 100道(九)反转链表(C++)
  • Linux之网络基础
  • Oracle收缩表空间的简单方法
  • C++设计模式行为模式———中介者模式
  • YB2503HV:高效率降压IC,助力电动车、太阳能设备等领域的能源转换
  • 如何使用Jest测试你的React组件
  • 微网能量管理研究
  • Java基础面试题02:简述什么是值传递和引用传递?
  • 【STL】10.set与map的模拟实现
  • Playwright(Java版) - 8: Playwright 元素交互的高级应用
  • 播放器开发之ffmpeg 硬件解码方案
  • n、nvm、nrm、pnpm、yarn各种指令大全
  • 数据库管理-根据日期字段进行数据筛选更新数据
  • 03. 运算符
  • 【最优清零方案——贪心+滑动窗口+线段树】
  • 一个点绕任意点旋转后的点的坐标
  • 大数据面试题每日练习--HDFS是如何工作的?
  • Python的3D可视化库 - vedo (2)visual子模块 基本可视化行为