银河麒麟操作系统 v10 中离线安装 Docker

银河麒麟操作系统 v10 中离线安装 Docker

  • 1. 查看系统版本
  • 2. 查看 Linux 内核版本(3.10以上)
  • 3. 查看 iptabls 版本(1.4以上)
  • 4. 判断处理器架构
  • 5. 离线下载 Docker 安装包
  • 6. 移动解压出来的二进制文件到 /usr/bin 目录中
  • 7. 配置 Docker 服务
    • 7.1 编辑 docker 的系统服务文件
    • 7.2 将下面的内容复制到刚创建的docker.service文件中
    • 7.3 为docker.service添加执行权限
    • 7.4 编辑daemon.json
    • 7.5 启动 Docker
    • 7.6 添加开机自动启动
  • 8. 安装 docker-compose

1. 查看系统版本

[root@localhost opt]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Lance)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Lance)"
ANSI_COLOR="0;31"
[root@localhost opt]#

2. 查看 Linux 内核版本(3.10以上)

[root@localhost opt]# uname -r
4.19.90-52.22.v2207.ky10.aarch64
[root@localhost opt]# uname -a
Linux localhost.localdomain 4.19.90-52.22.v2207.ky10.aarch64 #1 SMP Tue Mar 14 11:52:45 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
[root@localhost opt]# 

3. 查看 iptabls 版本(1.4以上)

[root@localhost opt]# iptables --version
iptables v1.8.5 (legacy)

4. 判断处理器架构

[root@localhost opt]# uname -p
aarch64
[root@localhost opt]# 

可以看到,系统处理器架构为 ARM 架构;如果为 x86 架构的,则会显示 x86_64;

5. 离线下载 Docker 安装包

https://download.docker.com/linux/static/stable/
在这里插入图片描述
点进去,选择想要安装的版本,我这里为了跟测试环境保持一致,下载了一个相对旧点的版本:docker-20.10.6.tgz

下载完成后,上传至服务器 /opt 目录下,然后解压:tar -zxvf docker-20.10.6.tgz

6. 移动解压出来的二进制文件到 /usr/bin 目录中

mv docker/* /usr/bin/

然后就可以测试下Docker

[root@localhost opt]# docker -v
Docker version 20.10.6, build 370c289
[root@localhost opt]# 
[root@localhost opt]# docker version
Client:Version:           20.10.6API version:       1.41Go version:        go1.13.15Git commit:        370c289Built:             Fri Apr  9 22:42:28 2021OS/Arch:           linux/arm64Context:           defaultExperimental:      true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@localhost opt]# 

此时Docker 还没启动,只是可以看到Docker 的版本信息了。

测试 Docker 启动:

[root@localhost opt]# dockerd
INFO[2024-01-17T16:37:43.099979439+08:00] Starting up                                  
WARN[2024-01-17T16:37:43.105526753+08:00] could not change group /var/run/docker.sock to docker: group docker not found 
INFO[2024-01-17T16:37:43.107420618+08:00] libcontainerd: started new containerd process  pid=38904
INFO[2024-01-17T16:37:43.107565679+08:00] parsed scheme: "unix"                         module=grpc
INFO[2024-01-17T16:37:43.107591219+08:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2024-01-17T16:37:43.107642999+08:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2024-01-17T16:37:43.107667279+08:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2024-01-17T16:37:43.132250984+08:00] starting containerd                           revision=05f951a3781f4f2c1911b05e61c160e9c30eaa8e version=v1.4.4
INFO[2024-01-17T16:37:43.179400349+08:00] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
INFO[2024-01-17T16:37:43.179620610+08:00] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.183035159+08:00] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.183499360+08:00] skip loading plugin "io.containerd.snapshotter.v1.btrfs"...  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs (xfs) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.183991662+08:00] loading plugin "io.containerd.snapshotter.v1.devmapper"...  type=io.containerd.snapshotter.v1
WARN[2024-01-17T16:37:43.184090582+08:00] failed to load plugin io.containerd.snapshotter.v1.devmapper  error="devmapper not configured"
INFO[2024-01-17T16:37:43.184142322+08:00] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.184627063+08:00] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.184991004+08:00] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.185386025+08:00] skip loading plugin "io.containerd.snapshotter.v1.zfs"...  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2024-01-17T16:37:43.185426025+08:00] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
WARN[2024-01-17T16:37:43.185509726+08:00] could not use snapshotter devmapper in metadata plugin  error="devmapper not configured"
INFO[2024-01-17T16:37:43.185534686+08:00] metadata content store policy set             policy=shared
INFO[2024-01-17T16:37:43.192321664+08:00] loading plugin "io.containerd.differ.v1.walking"...  type=io.containerd.differ.v1
INFO[2024-01-17T16:37:43.192369284+08:00] loading plugin "io.containerd.gc.v1.scheduler"...  type=io.containerd.gc.v1
INFO[2024-01-17T16:37:43.192454304+08:00] loading plugin "io.containerd.service.v1.introspection-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192522964+08:00] loading plugin "io.containerd.service.v1.containers-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192558844+08:00] loading plugin "io.containerd.service.v1.content-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192588405+08:00] loading plugin "io.containerd.service.v1.diff-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192619525+08:00] loading plugin "io.containerd.service.v1.images-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192649145+08:00] loading plugin "io.containerd.service.v1.leases-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192680805+08:00] loading plugin "io.containerd.service.v1.namespaces-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192713545+08:00] loading plugin "io.containerd.service.v1.snapshots-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.192742805+08:00] loading plugin "io.containerd.runtime.v1.linux"...  type=io.containerd.runtime.v1
INFO[2024-01-17T16:37:43.192931185+08:00] loading plugin "io.containerd.runtime.v2.task"...  type=io.containerd.runtime.v2
INFO[2024-01-17T16:37:43.193127946+08:00] loading plugin "io.containerd.monitor.v1.cgroups"...  type=io.containerd.monitor.v1
INFO[2024-01-17T16:37:43.193782948+08:00] loading plugin "io.containerd.service.v1.tasks-service"...  type=io.containerd.service.v1
INFO[2024-01-17T16:37:43.193849968+08:00] loading plugin "io.containerd.internal.v1.restart"...  type=io.containerd.internal.v1
INFO[2024-01-17T16:37:43.193969348+08:00] loading plugin "io.containerd.grpc.v1.containers"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194002468+08:00] loading plugin "io.containerd.grpc.v1.content"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194032788+08:00] loading plugin "io.containerd.grpc.v1.diff"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194063708+08:00] loading plugin "io.containerd.grpc.v1.events"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194096109+08:00] loading plugin "io.containerd.grpc.v1.healthcheck"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194130489+08:00] loading plugin "io.containerd.grpc.v1.images"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194159349+08:00] loading plugin "io.containerd.grpc.v1.leases"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194188669+08:00] loading plugin "io.containerd.grpc.v1.namespaces"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194216589+08:00] loading plugin "io.containerd.internal.v1.opt"...  type=io.containerd.internal.v1
INFO[2024-01-17T16:37:43.194398649+08:00] loading plugin "io.containerd.grpc.v1.snapshots"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194442309+08:00] loading plugin "io.containerd.grpc.v1.tasks"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194473650+08:00] loading plugin "io.containerd.grpc.v1.version"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194501590+08:00] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[2024-01-17T16:37:43.194767270+08:00] serving...                                    address=/var/run/docker/containerd/containerd-debug.sock
INFO[2024-01-17T16:37:43.194847951+08:00] serving...                                    address=/var/run/docker/containerd/containerd.sock.ttrpc
INFO[2024-01-17T16:37:43.194907571+08:00] serving...                                    address=/var/run/docker/containerd/containerd.sock
INFO[2024-01-17T16:37:43.194936211+08:00] containerd successfully booted in 0.063779s  
INFO[2024-01-17T16:37:43.203435713+08:00] parsed scheme: "unix"                         module=grpc
INFO[2024-01-17T16:37:43.203476293+08:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2024-01-17T16:37:43.203514214+08:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2024-01-17T16:37:43.203535454+08:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2024-01-17T16:37:43.204550216+08:00] parsed scheme: "unix"                         module=grpc
INFO[2024-01-17T16:37:43.204590876+08:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2024-01-17T16:37:43.204625736+08:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2024-01-17T16:37:43.204647717+08:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2024-01-17T16:37:43.261073806+08:00] Loading containers: start.                   
INFO[2024-01-17T16:37:43.841747309+08:00] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address 
INFO[2024-01-17T16:37:43.942240656+08:00] Firewalld: interface docker0 already part of docker zone, returning 
INFO[2024-01-17T16:37:44.034537461+08:00] Loading containers: done.                    
INFO[2024-01-17T16:37:44.071730559+08:00] Docker daemon                                 commit=8728dd2 graphdriver(s)=overlay2 version=20.10.6
INFO[2024-01-17T16:37:44.071914980+08:00] Daemon has completed initialization          
INFO[2024-01-17T16:37:44.123180096+08:00] API listen on /var/run/docker.sock           

可以看到 docker 可以正常启动,不过当前是在窗口中手动启动的,Ctrl + C,杀掉就好。

^CINFO[2024-01-17T16:38:04.425317678+08:00] Processing signal 'interrupt'                
INFO[2024-01-17T16:38:04.426455381+08:00] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
INFO[2024-01-17T16:38:04.426832962+08:00] Daemon shutdown complete                     
INFO[2024-01-17T16:38:04.426861062+08:00] stopping healthcheck following graceful shutdown  module=libcontainerd
INFO[2024-01-17T16:38:04.426897042+08:00] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby

7. 配置 Docker 服务

7.1 编辑 docker 的系统服务文件

vi /usr/lib/systemd/system/docker.service

7.2 将下面的内容复制到刚创建的docker.service文件中

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target

7.3 为docker.service添加执行权限

chmod +x /usr/lib/systemd/system/docker.service

7.4 编辑daemon.json

vi /etc/docker/daemon.json

并添加以下内容:

{"registry-mirrors": ["https://registry.docker-cn.com"],"exec-opts": ["native.cgroupdriver=systemd"]
}

保存后,执行:systemctl daemon-reload

7.5 启动 Docker

[root@localhost opt]# systemctl start docker
[root@localhost opt]# 
[root@localhost opt]# docker ps 
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@localhost opt]# 
[root@localhost opt]# docker -v
Docker version 20.10.6, build 370c289
[root@localhost opt]# 
[root@localhost opt]# docker info
Client:Context:    defaultDebug Mode: falseServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 0Server Version: 20.10.6Storage Driver: overlay2Backing Filesystem: xfsSupports d_type: trueNative Overlay Diff: trueuserxattr: falseLogging Driver: json-fileCgroup Driver: cgroupfsCgroup Version: 1Plugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslogSwarm: inactiveRuntimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2Default Runtime: runcInit Binary: docker-initcontainerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8erunc version: init version: de40ad0Security Options:seccompProfile: defaultKernel Version: 4.19.90-52.22.v2207.ky10.aarch64Operating System: Kylin Linux Advanced Server V10 (Lance)OSType: linuxArchitecture: aarch64CPUs: 64Total Memory: 252.8GiBName: localhost.localdomainID: JRHZ:QLCB:TIJQ:KEM4:Z56J:TFJN:WAAG:BT4T:S2IC:XVOM:VZNS:TU6UDocker Root Dir: /var/lib/dockerDebug Mode: falseRegistry: https://index.docker.io/v1/Labels:Experimental: falseInsecure Registries:127.0.0.0/8Live Restore Enabled: falseProduct License: Community Engine[root@localhost opt]# 

正常启动。

7.6 添加开机自动启动

systemctl enable docker

Docker 安装 参考: https://blog.csdn.net/qq_30665009/article/details/125938033

8. 安装 docker-compose

直接 GitHub 下载:docker/compose 选择自己喜欢的版本,这里直接拉满,下载当前最新的版本:v2.24.0
在这里插入图片描述
这里根据自己的架构,选择对应的包,下载就好了。

cp docker-compose-linux-aarch64  /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

查看版本

[root@localhost opt]# docker-compose -v
Docker Compose version v2.24.0
[root@localhost opt]# 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/412843.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于TCP的全双工网络编程实践

首先我们先了解一下什么是全双工通信&#xff1f; 全双工数据通信允许数据同时在两个方向上传输&#xff0c;因此&#xff0c;全双工通信相当于是两个单工通信方式的结合&#xff0c;它要求发送设备和接收设备都有独立的接收和发送能力。 TCP服务端代码&#xff1a; #includ…

【控制篇 / 分流】(7.4) ❀ 01. 对指定IP网段访问进行分流 ❀ FortiGate 防火墙

【简介】公司有两条宽带&#xff0c;一条ADSL拨号用来上网&#xff0c;一条移动SDWAN&#xff0c;已经连通总部内网服务器&#xff0c;领导要求&#xff0c;只有访问公司服务器IP时走移动SDWAN&#xff0c;其它访问都走ADSL拨号&#xff0c;如果你是管理员&#xff0c;你知道有…

系统性学习vue-vuex

系统性学习vue-vuex 理解vuexvuex工作原理搭建vuex环境案例Vuex的开发者工具使用getters配置项mapState与mapGettersmapActions和mapMutationsvuex模块化namespace 理解vuex 概念&#xff1a; 专门在Vue中实现集中式状态&#xff08;数据&#xff09;管理的一个Vue插件&#xf…

使用Sqoop的并行处理:扩展数据传输

使用Sqoop的并行处理是在大数据环境中高效传输数据的关键。它可以显著减少数据传输的时间&#xff0c;并充分利用集群资源。本文将深入探讨Sqoop的并行处理能力&#xff0c;提供详细的示例代码&#xff0c;以帮助大家更全面地了解和应用这一技术。 Sqoop的并行处理 在开始介绍…

Python用selenium实现自动登录和下单的项目实战

前言 学python对selenium应该不陌生吧 Selenium 是最广泛使用的开源 Web UI&#xff08;用户界面&#xff09;自动化测试套件之一。Selenium 支持的语言包括C#&#xff0c;Java&#xff0c;Perl&#xff0c;PHP&#xff0c;Python 和 Ruby。目前&#xff0c;Selenium Web 驱动…

【音视频原理】图像相关概念 ② ( 帧率 | 常见帧率标准 | 码率 | 码率单位 )

文章目录 一、帧率1、帧率简介2、常见帧率标准3、帧率 刷新率 二、码率1、码率简介2、码率单位 一、帧率 1、帧率简介 帧率 Frame Rate , 帧 指的是 是 画面帧 , 帧率 是 画面帧 的 速率 ; 帧率 的 单位是 FPS , Frames Per Second , 是 每秒钟 的 画面帧 个数 ; 帧率 是 动画…

头像空白问题

当用户没有设置头像时&#xff0c;我们可以使用用户名第一个字来当头像 主要涉及一个截取&#xff0c;截取字符串第一个字 变量名.charAt(0) 如果变量名为null或者undefine 那么就会报错 使用可选链操作符 &#xff1f; 当前面的值为nul或undefine时&#xff0c;就不会执行…

011:vue结合css动画animation实现下雪效果

文章目录 1. 实现效果2. 编写一个下雪效果组件 VabSnow.vue3. 页面使用4. 注意点 1. 实现效果 GIF录屏文件太卡有点卡&#xff0c;实际是很丝滑的 2. 编写一个下雪效果组件 VabSnow.vue 在 src 下新建 components 文件&#xff0c;创建VabSnow.vue组件文件 <template>…

第三届iEnglish全国ETP大赛展现教育游戏新趋势

随着社会步入数字化纪元,游戏作为信息交流和传播的重要载体,在教育领域的潜能日益凸显。特别是寓教于乐的“教育游戏”学习方式让更多家长和孩子体验到“玩中学,学中玩”的乐趣,在教育领域的潜能也日益凸显。 本周五(1月19日)晚上7点,国内首个教育游戏赛事、以“玩转英语,用iE…

在国外外出结账时应该怎样表述,柯桥生活英语学习

大家平时外出就餐时&#xff0c;尤其是那种外国餐厅&#xff0c;结账时都怎么表达&#xff1f;可能大家会脱口而出“how much”..... 如果你真的这么说&#xff0c;那可就“踩雷”了。因为&#xff0c;在歪果仁的文化中&#xff0c;用how引导的疑问句都或多或少涉及隐私问题&am…

触发器简述

数据库是与表有关的数据库对象&#xff0c;在执行insert&#xff0c;delete&#xff0c;update之前或之后&#xff0c;触发并执行触发器中定义的sql语句集合&#xff0c;来保证数据的完整性等操作,目前只支持行级触发器&#xff0c;而不支持语句触发器。 触发器的语法&#xff…

线程同步--生产者消费者模型

文章目录 一.条件变量pthread线程库提供的条件变量操作 二.生产者消费者模型生产者消费者模型的高效性基于环形队列实现生产者消费者模型中的数据容器 一.条件变量 条件变量是线程间共享的全局变量,线程间可以通过条件变量进行同步控制条件变量的使用必须依赖于互斥锁以确保线…