IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> arm64 linux 环境编译 moby 20.10.13 aarch64 -> 正文阅读

[系统运维]arm64 linux 环境编译 moby 20.10.13 aarch64

下载源码

wget  https://ghproxy.com/https://github.com/moby/moby/archive/refs/tags/v20.10.11.tar.gz

解压

tar -xvf v20.10.11.tar.gz

打patch(国内网络问题)

[root@10-2-1-202 src]# cd moby-20.10.13
[root@10-2-1-202 moby-20.10.13]# patch -p1 < ../docker.patch 
patching file Dockerfile
patching file hack/dockerfile/install/containerd.installer
patching file hack/dockerfile/install/proxy.installer
patching file hack/dockerfile/install/rootlesskit.installer
patching file hack/dockerfile/install/runc.installer
patching file hack/dockerfile/install/tini.installer
patching file hack/dockerfile/install/tomlv.installer
patching file sources.list.buster

docker.patch

diff -uprN moby-20.10.13/Dockerfile moby-20.10.13-fixed/Dockerfile
--- moby-20.10.13/Dockerfile	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/Dockerfile	2022-03-14 15:57:54.979953557 +0800
@@ -16,6 +16,7 @@ RUN echo 'Binary::apt::APT::Keep-Downloa
 ARG APT_MIRROR
 RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
  && sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
+ADD sources.list.buster /etc/apt/sources.list
 ENV GO111MODULE=off
 
 FROM base AS criu
diff -uprN moby-20.10.13/hack/dockerfile/install/containerd.installer moby-20.10.13-fixed/hack/dockerfile/install/containerd.installer
--- moby-20.10.13/hack/dockerfile/install/containerd.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/containerd.installer	2022-03-14 15:25:32.935341967 +0800
@@ -19,7 +19,7 @@ set -e
 
 install_containerd() (
 	echo "Install containerd version $CONTAINERD_VERSION"
-	git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd"
+	git clone https://ghproxy.com/https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd"
 	cd "$GOPATH/src/github.com/containerd/containerd"
 	git checkout -q "$CONTAINERD_VERSION"
 
diff -uprN moby-20.10.13/hack/dockerfile/install/proxy.installer moby-20.10.13-fixed/hack/dockerfile/install/proxy.installer
--- moby-20.10.13/hack/dockerfile/install/proxy.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/proxy.installer	2022-03-14 15:25:44.055368370 +0800
@@ -29,7 +29,7 @@ install_proxy_dynamic() {
 
 _install_proxy() {
 	echo "Install docker-proxy version $LIBNETWORK_COMMIT"
-	git clone https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork"
+	git clone https://ghproxy.com/https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork"
 	cd "$GOPATH/src/github.com/docker/libnetwork"
 	git checkout -q "$LIBNETWORK_COMMIT"
 	go build ${BUILD_MODE} -ldflags="$PROXY_LDFLAGS" -o ${PREFIX}/docker-proxy github.com/docker/libnetwork/cmd/proxy
diff -uprN moby-20.10.13/hack/dockerfile/install/rootlesskit.installer moby-20.10.13-fixed/hack/dockerfile/install/rootlesskit.installer
--- moby-20.10.13/hack/dockerfile/install/rootlesskit.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/rootlesskit.installer	2022-03-14 15:20:27.994617943 +0800
@@ -26,6 +26,8 @@ install_rootlesskit_dynamic() {
 
 _install_rootlesskit() (
 	echo "Install rootlesskit version ${ROOTLESSKIT_VERSION}"
+        # 国内支持
+        go env -w GOPROXY=https://goproxy.cn
 	for f in rootlesskit rootlesskit-docker-proxy; do
 		GOBIN="${PREFIX}" GO111MODULE=on go install ${BUILD_MODE} -ldflags="$ROOTLESSKIT_LDFLAGS" "github.com/rootless-containers/rootlesskit/cmd/${f}@${ROOTLESSKIT_VERSION}"
 	done
diff -uprN moby-20.10.13/hack/dockerfile/install/runc.installer moby-20.10.13-fixed/hack/dockerfile/install/runc.installer
--- moby-20.10.13/hack/dockerfile/install/runc.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/runc.installer	2022-03-14 15:25:54.635393490 +0800
@@ -15,7 +15,7 @@ install_runc() {
 	RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp"}"
 
 	echo "Install runc version $RUNC_VERSION (build tags: $RUNC_BUILDTAGS)"
-	git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
+	git clone https://ghproxy.com/https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
 	cd "$GOPATH/src/github.com/opencontainers/runc"
 	git checkout -q "$RUNC_VERSION"
 	if [ -z "$1" ]; then
diff -uprN moby-20.10.13/hack/dockerfile/install/tini.installer moby-20.10.13-fixed/hack/dockerfile/install/tini.installer
--- moby-20.10.13/hack/dockerfile/install/tini.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/tini.installer	2022-03-14 15:26:04.465416830 +0800
@@ -7,7 +7,7 @@
 
 install_tini() {
 	echo "Install tini version $TINI_VERSION"
-	git clone https://github.com/krallin/tini.git "$GOPATH/tini"
+	git clone https://ghproxy.com/https://github.com/krallin/tini.git "$GOPATH/tini"
 	cd "$GOPATH/tini"
 	git checkout -q "$TINI_VERSION"
 	cmake .
diff -uprN moby-20.10.13/hack/dockerfile/install/tomlv.installer moby-20.10.13-fixed/hack/dockerfile/install/tomlv.installer
--- moby-20.10.13/hack/dockerfile/install/tomlv.installer	2022-03-07 04:52:27.000000000 +0800
+++ moby-20.10.13-fixed/hack/dockerfile/install/tomlv.installer	2022-03-14 15:26:14.715441166 +0800
@@ -6,7 +6,7 @@
 
 install_tomlv() {
 	echo "Install tomlv version $TOMLV_COMMIT"
-	git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
+	git clone https://ghproxy.com/https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
 	cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
 	go build -v ${GO_BUILDMODE} -o "${PREFIX}/tomlv" "github.com/BurntSushi/toml/cmd/tomlv"
 }
diff -uprN moby-20.10.13/sources.list.buster moby-20.10.13-fixed/sources.list.buster
--- moby-20.10.13/sources.list.buster	1970-01-01 08:00:00.000000000 +0800
+++ moby-20.10.13-fixed/sources.list.buster	2020-12-28 12:06:30.000000000 +0800
@@ -0,0 +1,8 @@
+deb http://mirrors.163.com/debian/ buster main non-free contrib
+deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
+deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
+deb-src http://mirrors.163.com/debian/ buster main non-free contrib
+deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
+deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
+deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
+deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

执行构建

make binary

查看编译版本

[root@10-2-1-202 moby-20.10.13]# ll bundles/binary-daemon/
total 194172
-rwxr-xr-x 1 root root 31844584 Mar 14 16:02 containerd
-rw-r--r-- 1 root root       45 Mar 14 16:02 containerd.md5
-rw-r--r-- 1 root root       77 Mar 14 16:02 containerd.sha256
-rwxr-xr-x 1 root root  6160384 Mar 14 16:02 containerd-shim
-rw-r--r-- 1 root root       50 Mar 14 16:02 containerd-shim.md5
-rwxr-xr-x 1 root root  8388608 Mar 14 16:02 containerd-shim-runc-v2
-rw-r--r-- 1 root root       58 Mar 14 16:02 containerd-shim-runc-v2.md5
-rw-r--r-- 1 root root       90 Mar 14 16:02 containerd-shim-runc-v2.sha256
-rw-r--r-- 1 root root       82 Mar 14 16:02 containerd-shim.sha256
-rwxr-xr-x 1 root root 21037056 Mar 14 16:02 ctr
-rw-r--r-- 1 root root       38 Mar 14 16:02 ctr.md5
-rw-r--r-- 1 root root       70 Mar 14 16:02 ctr.sha256
lrwxrwxrwx 1 root root       11 Mar 14 16:02 dockerd -> dockerd-dev
-rwxr-xr-x 1 root root 58483096 Mar 14 16:02 dockerd-dev
-rw-r--r-- 1 root root       46 Mar 14 16:02 dockerd-dev.md5
-rw-r--r-- 1 root root       78 Mar 14 16:02 dockerd-dev.sha256
-rwxr-xr-x 1 root root    13348 Mar 14 16:02 dockerd-rootless-setuptool.sh
-rw-r--r-- 1 root root       64 Mar 14 16:02 dockerd-rootless-setuptool.sh.md5
-rw-r--r-- 1 root root       96 Mar 14 16:02 dockerd-rootless-setuptool.sh.sha256
-rwxr-xr-x 1 root root     5150 Mar 14 16:02 dockerd-rootless.sh
-rw-r--r-- 1 root root       54 Mar 14 16:02 dockerd-rootless.sh.md5
-rw-r--r-- 1 root root       86 Mar 14 16:02 dockerd-rootless.sh.sha256
-rwxr-xr-x 1 root root   505488 Mar 14 16:02 docker-init
-rw-r--r-- 1 root root       46 Mar 14 16:02 docker-init.md5
-rw-r--r-- 1 root root       78 Mar 14 16:02 docker-init.sha256
-rwxr-xr-x 1 root root  2769111 Mar 14 16:02 docker-proxy
-rw-r--r-- 1 root root       47 Mar 14 16:02 docker-proxy.md5
-rw-r--r-- 1 root root       79 Mar 14 16:02 docker-proxy.sha256
-rwxr-xr-x 1 root root 10103657 Mar 14 16:02 rootlesskit
-rwxr-xr-x 1 root root  6499684 Mar 14 16:02 rootlesskit-docker-proxy
-rw-r--r-- 1 root root       59 Mar 14 16:02 rootlesskit-docker-proxy.md5
-rw-r--r-- 1 root root       91 Mar 14 16:02 rootlesskit-docker-proxy.sha256
-rw-r--r-- 1 root root       46 Mar 14 16:02 rootlesskit.md5
-rw-r--r-- 1 root root       78 Mar 14 16:02 rootlesskit.sha256
-rwxr-xr-x 1 root root 13286472 Mar 14 16:02 runc
-rw-r--r-- 1 root root       39 Mar 14 16:02 runc.md5
-rw-r--r-- 1 root root       71 Mar 14 16:02 runc.sha256
-rwxr-xr-x 1 root root 39607984 Mar 14 16:02 vpnkit
-rw-r--r-- 1 root root       41 Mar 14 16:02 vpnkit.md5
-rw-r--r-- 1 root root       73 Mar 14 16:02 vpnkit.sha256
[root@10-2-1-202 binary-daemon]# file containerd
containerd: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=a1968ee4fc8193386434736c99ead2a8107f08a1, stripped
[root@10-2-1-202 binary-daemon]# file containerd-shim
containerd-shim: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
[root@10-2-1-202 binary-daemon]# file containerd-shim-runc-v2
containerd-shim-runc-v2: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
[root@10-2-1-202 binary-daemon]# file ctr
ctr: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), stripped 
[root@10-2-1-202 binary-daemon]# file dockerd-dev
dockerd-dev: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=3648fb646d9ab4ce80c938fbaf7bc9b76bf36514, not stripped
[root@10-2-1-202 binary-daemon]# file docker-init
docker-init: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=b7f88c2a8a0f401c6c6dce469db51d28f8b68a4b, stripped
[root@10-2-1-202 binary-daemon]# file docker-proxy
docker-proxy: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
[root@10-2-1-202 binary-daemon]# file runc
runc: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=f9a6e04b573c484eb2aa7879e6d6479fb4f67cc3, not stripped

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-03-15 23:07:58  更:2022-03-15 23:12:38 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/16 2:42:14-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码