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

在 Linux 系统(ubuntu/kylin)上安装 Docker

在 Linux 系统上安装 Docker 的步骤如下(以 Ubuntu/DebianCentOS/RHEL 为例):
请用./check-config config检查内核是否支持,necessarily 必须全部enable。
以下是脚本自行复制运行:

#!/usr/bin/env sh
set -e

EXITCODE=0

# bits of this were adapted from lxc-checkconfig
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in

possibleConfigs="
	/proc/config.gz
	/boot/config-$(uname -r)
	/usr/src/linux-$(uname -r)/.config
	/usr/src/linux/.config
"

if [ $# -gt 0 ]; then
	CONFIG="$1"
else
	: "${CONFIG:=/proc/config.gz}"
fi

if ! command -v zgrep > /dev/null 2>&1; then
	zgrep() {
   
		zcat "$2" | grep "$1"
	}
fi

kernelVersion="$(uname -r)"
kernelMajor="${kernelVersion%%.*}"
kernelMinor="${kernelVersion#$kernelMajor.}"
kernelMinor="${kernelMinor%%.*}"

is_set() {
   
	zgrep "CONFIG_$1=[y|m]" "$CONFIG" > /dev/null
}
is_set_in_kernel() {
   
	zgrep "CONFIG_$1=y" "$CONFIG" > /dev/null
}
is_set_as_module() {
   
	zgrep "CONFIG_$1=m" "$CONFIG" > /dev/null
}

color() {
   
	codes=
	if [ "$1" = 'bold' ]; then
		codes='1'
		shift
	fi
	if [ "$#" -gt 0 ]; then
		code=
		case "$1" in
			# see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
			black) code=30 ;;
			red) code=31 ;;
			green) code=32 ;;
			yellow) code=33 ;;
			blue) code=34 ;;
			magenta) code=35 ;;
			cyan) code=36 ;;
			white) code=37 ;;
		esac
		if [ "$code" ]; then
			codes="${codes:+$codes;}$code"
		fi
	fi
	printf '\033[%sm' "$codes"
}
wrap_color() {
   
	text="$1"
	shift
	color "$@"
	printf '%s' "$text"
	color reset
	echo
}

wrap_good() {
   
	echo "$(wrap_color "$1" white): $(wrap_color "$2" green)"
}
wrap_bad() {
   
	echo "$(

相关文章:

  • 玻璃厂退火炉“温度智囊”:Profinet转ModbusRTU网关
  • 目标检测YOLO实战应用案例100讲- 基于卷积神经网络的小目标检测算法研究与应用
  • 灵霄破茧:仙途启幕 - 灵霄门新篇-(4)
  • linux环境定时重启服务的流程分享
  • 关于FocalLoss 损失函数
  • 【C++算法】54.链表_合并 K 个升序链表
  • Ansible:role企业级实战
  • 4-6记录(B树)
  • 使用ZYNQ芯片和LVGL框架实现用户高刷新UI设计系列教程(第七讲)
  • 【React】副作用 setState执行流程 内置钩子(Effect Callback Reducer)React.memo
  • 从 STP 到 RSTP 再到 MSTP:网络生成树协议的工作机制与发展
  • Docker部署.NetCore8项目
  • 【Axure视频教程】中继器表格轮播含暂停效果
  • 蓝桥杯真题:数字串个数
  • 【今日三题】小乐乐改数字 (模拟) / 十字爆破 (预处理+模拟) / 比那名居的桃子 (滑窗 / 前缀和)
  • Spring Security6 从源码慢速开始
  • 系统思考—提升解决动态性复杂问题能力
  • C++对象生命周期管理:从构造到析构的完整指南
  • Unity Addressables资源生命周期自动化监控技术详解
  • 【智能指针】—— 我与C++的不解之缘(三十三)