当前位置: 首页 > news >正文

kylin安装docker

1. 前言

本文详细介绍如何在kylin v10上安装docker。系统环境如下:

dockder:        20.10.7
linux os:       kylinv 10 (GFB)
linux kernel:   4.19.90-52.23.v2207.gfb01.ky10.aarch64

 
 

2. 安装docker

2.1. 下载docker二进制包

wget https://mirror.nju.edu.cn/docker-ce/linux/static/stable/aarch64/docker-20.10.7.tgz

此处采用的是从南京大学开源镜像站下载,速度比较快,当然也可以直接从docker官网下载。

 

2.2. 解压docker二进制包

tar -zxvf docker-20.10.7.tgz && mv docker/* /usr/local/bin/ && rm -rf docker

 

2.3. 添加service文件

cat << EOF > /etc/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 containerd.service
Requires=docker.socket[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
EOF

 

2.4. 添加docker.socket文件

cat << EOF > /etc/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker[Install]
WantedBy=sockets.target
EOF

 

2.5. 启动docker engine服务

systemctl daemon-reload
systemctl enable docker.service
systemctl start docker.service

 

2.6. 验证docker是否安装成功

执行docker info命令,如果显示如下信息,则docker安装成功。

Client:Context:    defaultDebug Mode: falseServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 1Server Version: 20.10.7Storage 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.runc.v2 io.containerd.runtime.v1.linux runcDefault Runtime: runcInit Binary: docker-initcontainerd version: d71fcd7d8303cbf684402823e425e9dd2e99285drunc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7init version: de40ad0Security Options:seccompProfile: defaultKernel Version: 4.19.90-52.23.v2207.gfb01.ky10.aarch64Operating System: Kylin Linux Advanced Server V10 (GFB)OSType: linuxArchitecture: aarch64CPUs: 96Total Memory: 126.2GiBName: node0ID: 2K52:3OWC:UBNU:KFFJ:3GTW:2V4E:7YKQ:BKZN:H7LW:KLHD:NVZA:JX65Docker 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

 
 

3. 参考资料

  • https://docs.docker.com/engine/install/binaries/
  • https://github.com/docker/packaging/tree/main/pkg/docker-engine/common/systemd
http://www.lryc.cn/news/514201.html

相关文章:

  • 【Yarn】通过JMX采集yarn相关指标的Flink任务核心逻辑
  • 鸿蒙HarmonyOS开发:基于Swiper组件和自定义指示器实现多图片进度条轮播功能
  • Excel 身份证号计算年龄
  • 【2024年-6月-14日-开源社区openEuler实践记录】探索 test - tools:高效测试的开源宝库
  • 2022浙江大学信号与系统笔记
  • DeepSeek-VL2
  • 前端⾯试⼋股⽂
  • 【Rust自学】8.6. HashMap Pt.2:更新HashMap
  • Python异常处理详解:概念、语法与实践
  • Kotlin在医疗大健康域的应用实例探究与编程剖析(上)
  • QT----------QT Data Visualzation
  • 什么是Sight Words(信号词)
  • SpringBoot日志快速集成详解-生产实战
  • 路由技术在网络中的作用及特点
  • 【Python系列】Flask 与 FastAPI:两个 Python Web 框架的对比分析
  • 云手机:虚拟技术的革命性应用与实体手机的优劣对比
  • 3. C语言 数据类型
  • npm install 安装选项 -d -s -g
  • pdf预览兼容问题- chrome浏览器105及一下预览不了
  • 【可实战】需求分析-测试计划↓-测试设计-测试执行-测试总结↓(包含测试计划、测试总结模板,以公司要求为准)
  • MySQL 03 章——基本的SELECT语句
  • 【项目】智能BI洞察引擎 测试报告
  • javaEE-文件操作和IO-文件
  • 2025跨年倒计时
  • 下载mysql免安装版和配置
  • 代码模板-C语言常用的errno的名字、值以及对应关系?转换字符串函数?(errno.h, strerror; errno -l; man errno)
  • 全新免押租赁系统助力商品流通高效安全
  • 5.微服务灰度发布落地实践(rocketmq增强)
  • MySql核心面试面试问题解析
  • logback之自定义pattern使用的转换器