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

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

时间:2024-10-18 17:12:37浏览次数:8  
标签:BClinux service containerd 离线 systemd https docker com

■ 下载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/likingzi/p/18474655

相关文章

  • 容器运维必备-Docker 常用命令
    前言:在Kubernetes的日常运维中,虽然我们主要依赖kubectl命令来管理容器和集群,但有时候,Docker的一些命令因其直观和便捷性,能够为我们提供极大的帮助。以下是一些Docker的常用命令,它们可以在Kubernetes环境中作为辅助工具使用,以提高我们的工作效率和操作的灵活性以下是Doc......
  • 二进制安装 Docker 以及 Docker Compose
    Author:ACatSmilingSince:2024-10-12Docker安装官网下载安装包。(以下示例脚本为下载最新版Docker离线压缩包,也可以用浏览器打开官网地址直接下载再传到服务器。如果使用该脚本,下面的第2、3步可以不执行。)#!/bin/bashset-u#docker官网下载地址url='https://d......
  • Docker 用例:15 种最常见的 Docker 使用方法
    容器化应用程序而不是将它们托管在虚拟机上是过去几年一直流行的概念,使容器管理流行起来。Docker处于这一转变的核心,帮助组织无缝地采用容器化技术。最近,Docker用例遍布所有行业,无论规模大小和性质如何。什么是Docker?Docker是一种容器化技术,它使开发人员能够将服务及其依......
  • 1.docker基础课程-docker安装
    如今,docker的使用已是越来越广泛熟练的掌握docker的使用已经是作为后端开发工程师必不可少的技能之一了docker是干啥的我们都知道,windows环境和linux环境是不一样的简单来说就是,不同的应用程序所依赖的环境不一样,如果把他们依赖的软件都安装在一个服务器上,不仅需要调试很久......
  • 国外电商系统开发-运维系统Docker镜像
            如果您在【主机配置】中,添加主机的时候使用的是root超级管理员,而且该主机中确实有docker镜像存在,那么运维系统会自动发现该列表,并且展现在网页中                自动发现的时间,间隔是30分钟一次。在该页面,您可以自行操作docker镜像功能。 ......
  • docker-certbot-dnspod 使用 Docker 申请、续期免费证书
    项目地址https://github.com/chenlongqiang/docker-certbot-dnspod背景近期免费证书有效期从1年缩短到3个月,避免经常要上云平台手动申请,所以想找个工具可以简单的申请、续期证书。通过了解,发现Certbot工具,但官方没提供Dnspod插件,于是找了Python3的封装并打包成......
  • dockerfile中nuget源加载失败Retrying 'FindPackagesByIdAsync' for source 'xxx'
    问题描述:最近jenkins打包总是提示微软源加载不到Retrying'FindPackagesByIdAsync'forsource'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.primitives/index.json'.Anerroroccurredwhilesendingtherequest.解决方案:dockerfile中添加国内源,改用华......
  • 如何更新docker中镜像的版本?
    如何更新docker中镜像的版本?#进入docker-compose.yml文件所在的文件夹下cd/root/data/docker_data/npm#停止容器docker-composedown#数据备份#万事先备份,以防万一cp-r/root/data/docker_data/npm/root/data/docker_data/npm.archive#拉取新版本镜像doc......
  • 全网热点信息监控舆情监控,一个docker一行命令启动完成部署,汇聚全网27个主流网站实时热
    全网热点信息监控舆情监控,一个docker一行命令启动完成部署,汇聚全网27个主流网站实时热榜,热点一“手”掌握,今日热榜API,一个聚合热门数据的API接口,支持RSS模式及Vercel部署。今日热榜汇聚全网热点,热门尽览无余,今日热榜可以为用户提供最新、最热门的信息,尽览各大平......
  • 【Docker系列】docker-compose down 命令详解
    ......