Docker 安装之信创适配国产 C86 架构:从入门到部署全攻略

Docker 安装之信创适配国产 C86 架构:从入门到部署全攻略


本文提供了详细的指导,帮助用户在国产 C86 架构下安装和配置 Docker 服务,尤其针对信创系统中的适配需求。文章涵盖了从下载安装 Docker 静态二进制文件到配置 docker.service 的完整步骤,解决了常见错误如 “library initialization failed” 等问题,并介绍了如何通过 ulimit 配置优化 Docker 性能。此外,还包含了 Docker Compose 的安装方法和一键安装国产 C86 架构 Docker 的安装包。通过这篇教程,用户可以顺利地在国产系统上部署 Docker 服务,适应信创环境的需求。

安装包地址一键安装国产信创C86架构的Docker.tar.gz

一 下载安装包

下载静态二进制文件对应版本的.tgz文件,比如 docker-24.0.9.tgz

二 解压文件
tar xzvf docker-24.0.9.tgz
三 拷贝文件
sudo cp docker/* /usr/bin/
# 清除安装包
# rm -rf containerd containerd-shim-runc-v2 ctr docker docker-init docker-proxy dockerd runc
四 编辑service
vim /etc/systemd/system/docker.service
sudo chmod +x /etc/systemd/system/docker.service

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 graph
# ExecStart=/usr/bin/dockerd --data-root=/home/serv/dockerdata
# ExecStart=/usr/bin/dockerd --graph=/home/serv/dockerdata --default-ulimit nofile=65536:65536
ExecStart=/usr/bin/dockerd --graph=/home/serv/dockerdata
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=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

应用启动报错

library initialization failed - unable to allocate file descriptor table - out
of memory

需配置

--default-ulimit nofile=65536:65536
五 启动docker
# 重新加载配置
sudo systemctl daemon-reload
# 开始
sudo systemctl start docker 
# 停止
sudo systemctl stop docker 
# 重启
sudo systemctl restart docker
# 查看状态
sudo systemctl status docker
# 创建网络
# sudo docker network create --driver bridge appnet
# 清理Docker的缓存
# docker system prune
六 Docker加入开机启动
$ sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /etc/systemd/system/docker.service.
七 安装docker-compose

下载静态二进制文件 ,docker-compose-linux-x86_64。

$ cp ./docker-compose-linux-x86_64 /usr/bin/docker-compose
# 添加执行权限
$ sudo chmod +x /usr/bin/docker-compose
# 测试安装成功
$ docker-compose version
# Docker Compose version v2.28.1
八 Q&A
# 运行时报错
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: container_linux.go:328: starting container process caused "permission denied": unknown

在 yml 文件中加

security_opt:
	- seccomp:unconfined
九 一键安装包

制作了 一键安装国产信创C86架构的Docker 安装包,docker 版本为 20.10.24 支持国产 Linux 内核操作系统,比如麒麟等。安装包地址如下:
一键安装国产信创C86架构的Docker

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

敲代码不忘补水

感谢有你,让我的创作更有价值!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值