华为鲲鹏+银河麒麟v10 安装 docker-ce

这篇具有很好参考价值的文章主要介绍了华为鲲鹏+银河麒麟v10 安装 docker-ce。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

设备:硬件:仅有ARM处理器,无GPU和NPU,操作系统麒麟银河V10,Kunpeng-920

#######参考原链接#########

华为鲲鹏+银河麒麟v10 安装 docker-ce 踩坑 - akiyaの博客

在 arm64(aarch64) 架构服务器上基于国产化操作系统安装 docker 服务

# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Tercel)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Tercel)"
ANSI_COLOR="0;31"

吐槽

所谓的国产操作系统在我看来即换皮改名操作系统,不可否认他们在权限审计方面做的比原版开源的操作系统更复杂更细腻(但是这些应该都可以自己通过 PAM 之类的配置吧)。

由于工作原因需要接触当前主流的大部分 GNU/Linux*BSD国产操作系统,在目前已接触的多款所谓的基于 Debian 或 Fedora 二次开发的操作系统中感触最深的不是他们上面加的各种权限审计限制,而是他们改了包名导致在安装 deb 或者 rpm 包时出现各种依赖问题。例如 CentOS7 的 rpm 包标识为 el7 麒麟上面则改成了 ky10,在安装一些软件时由于依赖问题导致同名包安装不上,如果卸载系统上已有包可能会出现系统某些软件服务出现问题,如果不卸载则只能带上痛苦面具去解决冲突。真就自主研发靠改名了。

国产的各种麒麟操作系统由于使用者多为政府单位,运行环境又是隔离内网,导致一般情况下只有安装光盘没有完整的软件源

寻找软件源

据说银河麒麟基于 CentOS7,但是通过测试最终添加 CentOS8 的源才可以用,因为他喵的 CentOS7 只有 x86_64,而 CentOS8 才有 aarch64,厂商的话都信不得哦。手动配置了 CentOS8 的源后,yum makecache 可以正常缓存,但是 yum -y update 会出现多个依赖错误问题,通过 yum -y install <package-name> 可以安装软件,但是依赖问题依然很难受。

最终在配置好 CentOS8 与 Docker-ce 官方源后由于依赖问题放弃了通过 yum 在线安装,直接下载如下 rpm 包安装依然不行。

通过二进制安装 docker

通过在线软件源和 rpm 包不能直接安装,那么只能选择通过编译安装了,去官网找了下发现提供有编译好的 docker 二进制包,直接下载二进制包安装吧,感谢 golang 的跨平台性。

安装条件

64位的操作系统

# uname -p
aarch64

Linux 内核版本 ≥ 3.10

# uname -r
4.19.90-17.ky10.aarch64

iptables 版本 ≥ 1.4

# iptables --version
iptables v1.8.1 (legacy)

一个 ps 可执行文件,通常由 procps 或类似的包提供。

安装 Docker-ce

  1. 选择并下载 docker-ce 二进制包文件

    官网下载地址:Index of linux/static/stable/aarch64/

wget https://download.docker.com/linux/static/stable/aarch64/docker-20.10.7.tgz

2.解压下载好的压缩包

tar -zxvf docker-20.10.7.tgz

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

mv docker/* /usr/bin/

4.测试启动

dockerd

添加 systemd

  1. 添加 docker 的 systemd 服务脚本至 /usr/lib/systemd/system/

    脚本参考自 https://github.com/docker/docker-ce

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

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket containerd.service

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process
OOMScoreAdjust=-500

[Install]
WantedBy=multi-user.target

2.根据 docker.service 中 Unit.After 需求添加 docker.socket 脚本至 /usr/lib/systemd/system/

脚本参考自 https://github.com/docker/docker-ce

vim  /usr/lib/systemd/system/docker.socket

[Unit]
Description=Docker Socket for the API

[Socket]
# If /var/run is not implemented as a symlink to /run, you may need to
# specify ListenStream=/var/run/docker.sock instead.
ListenStream=/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target

注意:如果缺少该文件,启动 docker 时会报如下错误:

# systemctl start docker
Failed to start docker.service: Unit docker.socket not found.

3.根据 docker.service 中 Unit.After 需求添加 containerd.service 脚本至 /usr/lib/systemd/system/

脚本参考自 https://github.com/containerd/containerd

vim  /usr/lib/systemd/system/containerd.service

# Copyright The containerd Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/containerd

Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=infinity
# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target

注意:如果缺少该文件,启动 docker 时会报如下错误:

# systemctl restart docker
Failed to restart docker.service: Unit containerd.service not found.

4.重载 systemd 配置文件

systemctl daemon-reload

5.创建 docker 组

groupadd docker

如不创建 docker 组在通过 systemctl 启动时会报错如下

Dependency failed for Docker Application Container Engine.
Job docker.service/start failed with result 'dependency'.

6.启动 docker 服务

systemctl start docker
systemctl enable docker

7.修改 docker 配置文件并查看安装好的 docker 基本信息

在 /etc/docker/daemon.json 中添加如下内容:

vim  /etc/docker/daemon.json

{
    "graph": "/data/docker",
    "storage-driver": "overlay2",
    "exec-opts": [
        "native.cgroupdriver=systemd"
    ],
    "registry-mirrors": [
        "https://t5t8q6wn.mirror.aliyuncs.com"
    ],
    "bip": "172.8.94.1/24"
}

重启 docker 服务

systemctl restart docker

查看 docker info

#######################常用操作命令##############

1.查看系统版本,确认版本
# cat /etc/kylin-release
Kylin Linux Advanced Server release V10 (Tercel)
2.查看系统架构(服务器如果是鲲鹏,架构是aarch64)
# uname -p
aarch64
3.内核版本
# uname -r
4.19.90-23.8.v2101.ky10.aarch64
4.iptables版本
# iptables --version
iptables v1.8.1 (legacy)
5.启动docker
systemctl start docker
systemctl enable docker
6.获取操作系统的版本详细信息
lsb_release -a(第一种)
cat /etc/os-release (第二种)
7.查看系统是64位还是32位
第一种方式:getconf LONG_BIT
第二种方式:file /bin/ls
第三种方式:lsb_release  -a
8.查看linux版本
第一种方式使用这个命令查看 lsb_release -a
第二种方式使用这个命令查看cat /etc/issue(仅适用于linux)
第三种方式使用这个命令查看 执行cat /etc/redhat-release
9.查看CPU配置信息
cat /proc/cpuinfo
lscpu
10.查看内存配置信息
cat /proc/meminfo
11.查看硬盘信息
df -h
12.查看当前linux的版本
cat /etc/redhat-release
rpm -q centos-release
13.修改DNS配置
vim /etc/resolv.conf
14.查看外网IP
curl cip.cc
curl ifconfig.me
curl ipinfo.io
15.获取操作系统分支号
hostnamectl

#############修改docker的root路径############

vim /etc/docker/daemon.json

{
        "data-root":"/data/docker",
        "exec-opts":[
                "native.cgroupdriver=systemd"
        ]
}
 文章来源地址https://www.toymoban.com/news/detail-460703.html

到了这里,关于华为鲲鹏+银河麒麟v10 安装 docker-ce的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

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

    可以看到,系统处理器架构为 ARM 架构;如果为 x86 架构的,则会显示 x86_64 ; https://download.docker.com/linux/static/stable/ 点进去,选择想要安装的版本,我这里为了跟测试环境保持一致,下载了一个相对旧点的版本: docker-20.10.6.tgz 下载完成后,上传至服务器 /opt 目录下,然后解压

    2024年01月23日
    浏览(47)
  • 银河麒麟V10(Tercel)服务器版安装 Docker

      注:以上内容仅提供参考和交流,请勿用于商业用途,如有侵权联系本人删除!

    2024年02月11日
    浏览(40)
  • 银河麒麟V10(Lance)服务器版安装 Docker

    注:以上内容仅提供参考和交流,请勿用于商业用途,如有侵权联系本人删除!

    2024年02月09日
    浏览(84)
  • 银河麒麟高级服务器操作系统V10下载安装及安装docker

    银河麒麟操作系统v10是中国电子研发的操作系统,该系统充分适应5G时代需求,打通手机、平板电脑、PC等,实现多端融合。 x86/兆芯/海光 Kylin-Server-10-SP2-x86-Release-Build09-20210524.iso 链接:https://pan.baidu.com/s/16sa8sumcJzXI95ip9gwptg 提取码:wxyu arm64/飞腾/鲲鹏 Kylin-Server-10-SP2-aarch64-Rel

    2024年01月16日
    浏览(57)
  • 鲲鹏 ARM 架构 麒麟 Lylin v10 安装 Node 和 NVM (离线)

    最近做一个银行的项目,银行的服务器是鲲鹏ARM架构的服务器,并且是麒麟v10的系统,这里记录一下在无法访问外网安装安装Node和NVM。 鲲鹏 ARM 架构 麒麟 Lylin v10 安装 Mysql8.3 (离线)-CSDN博客 鲲鹏 ARM 架构 麒麟Lylin v10 安装 Nginx (离线)-CSDN博客 鲲鹏 ARM 架构 麒麟 Lylin v10 安装 P

    2024年04月17日
    浏览(27)
  • 银河麒麟V10 达梦安装教程

    安装前先准备要安装包,包需要需要区分X86和arm架构。 版本为:dm8_20230419_FTarm_kylin10_sp1_64.iso 达梦数据库下载地址: https://www.aliyundrive.com/s/Qm7Es5BQM5U   第一步创建用户 su - root 1. 创建安装用户组 dminstall。 groupadd -g 12345 dminstall 2. 创建安装用户 dmdba。 useradd -u 12345 -g dimnstall

    2024年02月12日
    浏览(88)
  • 安装【银河麒麟V10】linux系统

    最近客户的服务器是麒麟的操作系统,因为要在上面安装我们的应用所以,要找镜像在本地搭建测试环境,看看有什么问题,把遇到的问题和操作总结一下。因为客户的服务器是内网,没网还需要挂载镜像,所以还需要挂载镜像。 1.系统下载 系统下载也走了很多弯路。就不说

    2024年02月06日
    浏览(85)
  • 虚拟机安装银河麒麟V10系统

    最近需要在银河麒麟V10系统上使用达梦数据库,记录一下使用虚拟机 VMware 15,16也可以 银河麒麟V10,可在官网上下载镜像文件 https://www.kylinos.cn/ 下载桌面操作系统版本,可申请免费试用。 新建虚拟机,选择典型安装,也可以自定义安装,典型安装能快速创建一个虚拟机,后

    2024年02月05日
    浏览(86)
  • 银河麒麟 linux V10 安装JDK

    1、安装JDK之前,先查看系统是否已安装JDK相关软件包:  2. 如果已经安装过,可以先卸载(可以跳过)  3. 下载并解压jdk包 4.设置Java环境变量,修改系统配置文件/etc/profile,命令:pluma  /etc/profile ,在文件末尾添加如下图所示部分,其中JAVA_HOME路径根据自己实际情况进行更

    2024年02月11日
    浏览(45)
  • 银河麒麟V10安装mysql8.0

    0、环境 操作系统:银河麒麟V10 计划安装mysql版本:V8.0.23 1、下载 MySQL Yum Repository 2、添加 MySQL Yum Repository 3、安装mysql 4、启动mysql服务 5、查看mysql默认密码

    2024年02月11日
    浏览(55)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包