首页 > 系统相关 >ARM架构鲲鹏主机BClinux离线安装docker步骤

ARM架构鲲鹏主机BClinux离线安装docker步骤

时间:2024-10-29 11:21:23浏览次数:3  
标签:BClinux service containerd 离线 systemd https docker com

简介: 下载并安装适用于ARM架构的Docker CE二进制文件,解压后移动至/usr/bin目录。创建docker组,配置systemd服务脚本(docker.service、docker.socket、containerd.service),重载systemd配置,启动并启用docker服务。编辑daemon.json配置存储驱动、镜像加速地址等,最后拉取所需镜像。

■ 下载arm架构二进制文件安装包

http://mirrors.163.com/docker-ce/linux/static/stable/aarch64/
docker-27.3.1.tgz                                  21-Sep-2024 01:36     66M

■ 解压二进制文件移动到 /usr/bin 目录

tar xvfz docker-27.3.1.tgz
ls -l docker
cp docker/* /usr/bin/

■ 测试启动

dockerd

■ 添加 docker 的 systemd 服务脚本

脚本参考自 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

■ 根据 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
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target

■ 根据 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

■ 重载 systemd 配置文件

systemctl daemon-reload

■ 创建 docker 组

groupadd docker

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

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

■ 启动 docker 服务

systemctl status docker
systemctl start docker
systemctl enable docker
systemctl restart docker

■ 配置合适的容器位置、网络镜像地址

vim /etc/docker/daemon.json
{
  "storage-driver": "overlay2",
  "registry-mirrors": [
    "https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com",
    "https://docker.m.daocloud.io",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://your_preferred_mirror",
    "https://dockerhub.icu",
    "https://docker.registry.cyou",
    "https://docker-cf.registry.cyou",
    "https://dockercf.jsdelivr.fyi",
    "https://docker.jsdelivr.fyi",
    "https://dockertest.jsdelivr.fyi",
    "https://mirror.aliyuncs.com",
    "https://dockerproxy.com",
    "https://mirror.baidubce.com",
    "https://docker.m.daocloud.io",
    "https://docker.nju.edu.cn",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://docker.mirrors.ustc.edu.cn",
    "https://mirror.iscas.ac.cn",
    "https://docker.rainbond.cc"
  ],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "data-root": "/u01/docker"
}

■ 拉取想要的镜像

docker pull oraclelinux:8

如无法 pull 则需配置合适的镜像地址,或者下载容器镜像。

标签:BClinux,service,containerd,离线,systemd,https,docker,com
From: https://www.cnblogs.com/yuweijade/p/18512582

相关文章

  • centos 安装docker
    #更新yumupdate#查看可安装的docker版本信息,我这儿在腾讯云服务器上查到的是旧的yuminfodocker 下面是deepseekai的回答:使用清华大学的镜像源来安装DockerCE是一个不错的选择,因为这样可以加快下载速度。以下是使用清华大学镜像源安装DockerCE的完整步骤:###1.安......
  • AvaloniaUI项目离线开发全攻略:IDE安装、模板应用与NuGet私有化部署一站式解决
    1.引言在网络受限或完全离线的环境中开发.NET项目(本文示例为AvaloniaUI项目),可能会遇到一些挑战。本文将为您提供一套完整的离线开发解决方案,包括IDE的安装、AvaloniaUI模板的配置、私有化NuGet服务的部署以及NuGet包的制作和上传等。2.IDE安装指南VisualStudio2022安装V......
  • centos中docker安装mysql
    用来记录1先升级yumupdate,遇到问题,解决在上篇centos7yum报错Cannotfindavalidbaseurlforrepo:base/7/x86_642安装docker需要的工具包3配置docker的yum源位置报错,网上查询说是因为国内访问不到docker官方镜像,但是直接在网页里打开连接可以下载,换成阿里云后成......
  • docker是什么?
    Docker是一种开源的容器化平台,可以将应用程序与其依赖项打包到一个称为容器的独立单元中。容器是一个可移植和可扩展的环境,内含应用程序的代码、运行时环境、系统工具、系统库等。它允许开发人员将应用程序与其依赖项一起打包,以便在任何地方运行,无论是开发环境、测试环境还是生......
  • 使用 Docker可以 做什么?
    我可以使用Docker 快速、一致地交付您的应用程序。Docker允许开发人员使用提供应用程序和服务的本地容器在标准化环境中工作,从而简化了开发生命周期。容器非常适合持续集成和持续交付(CI/CD)工作流。考虑以下示例场景:您的开发人员在本地编写代码并使用Docker容器与同......
  • 初次申请aws ec2,安装ubuntu,docker,jellyfin
    初次申请awsec2免费12个月,安装ubuntu,docker,jellyfin申请的是海外,因为个人使用,国内无法申请1. 创建EC2实例登录AWS控制台:访问 AWS控制台 并登录你的账户。选择EC2服务:在服务面板中找到并点击 EC2。启动实例:点击 LaunchInstance(启动实例)。选......
  • 如何系统地学习 Docker
    Docker是一种开放源代码的软件平台,它提供了在容器中自动化应用程序的部署、管理和运行。如何系统地学习Docker包括了以下几个步骤:了解Docker的基本概念和组件、掌握Docker的核心操作和命令、熟悉创建和管理Docker容器的过程、学习Dockerfile和镜像构建、探索Docker组......
  • 在微服务架构中,Docker容器的自动化部署是否真的能够提高开发效率?这是通过什么指标来衡
    目录一Docker容器的自动化部署1.自动化部署的基本概念2.Docker在微服务中的角色二提高开发效率的指标1.部署频率2.部署失败率3.恢复时间4.开发周期时间5.团队协作效率三使用Docker进行微服务自动化部署四结论在现代软件开发中,微服务架构正逐渐成为......
  • Docker
    Docker基础镜像(Image):类似于虚拟机中的镜像,是一个包含有文件系统的面向Docker引擎的只读模板。任何应用程序运行都需要环境,而镜像就是用来提供这种运行环境的。例如一个Ubuntu镜像就是一个包含Ubuntu操作系统环境的模板,同理在该镜像上装上Apache软件,就可以称为Apache镜像。容器......
  • docker 常用命令记录
    dockerps-a//查看系统所有容器dockerimages//查看系统所有镜像dockerrmcontain_namedockerrmcontainid//删除指定容器dockerrmiimage_namedockerrmiimageid//删除指定镜像dockerinspectcontain_name|grepMounts-A30//查看容器挂载目录do......