zss0hs 发表于 2022-10-19 00:44:21

AXT1800 64 位 带 docker 固件

本帖最后由 zss0hs 于 2023-3-11 21:05 编辑

AXT1800 64 位 带 docker 固件使用的大雕原版仓库:https://github.com/coolsnowwolf/openwrt-gl-ax1800.git   使用原版仓库选择 docker-ce 包,到编译 runc 包时会报错,导致编译失败:
make: Entering directory '/home/jht/openwrt-gl-ax1800/build_dir/target-aarch64_cortex-a53_musl/runc-1.0.0-rc10/.go_work/build/src/github.com/opencontainers/runc'
go build -buildmode=pie-ldflags "-X main.gitCommit=dc9208a3303feef5b3839f4323d9beb36df0a9dd -X main.version=1.0.0-rc10 " -tags "" -o runc .
go: cannot find main module, but found vendor.conf in /home/jht/openwrt-gl-ax1800/build_dir/target-aarch64_cortex-a53_musl/runc-1.0.0-rc10/.go_work/build/src/github.com/opencontainers/runc
      to create a module there, run:
      go mod init
make: *** Error 1
make: Leaving directory '/home/jht/openwrt-gl-ax1800/build_dir/target-aarch64_cortex-a53_musl/runc-1.0.0-rc10/.go_work/build/src/github.com/opencontainers/runc'
make: *** Error 2
make: Leaving directory '/home/jht/openwrt-gl-ax1800/feeds/packages/utils/runc'
time: package/feeds/packages/runc/compile#1.41#2.15#3.90
make: *** Error 2
make: Leaving directory '/home/jht/openwrt-gl-ax1800'
make: *** Error 2
make: Leaving directory '/home/jht/openwrt-gl-ax1800'
make: *** 错误 2    原因是 packages 仓库升级了 golang, 然后导致了 runc 包编译失败:https://github.com/coolsnowwolf/lede/issues/6465    这个问题后来已经在 packages 仓库的 master 分支中修复了,所以我直接去 packages 仓库的 master 分支中,在 golang 版本还是 1.17.3 的历史版本中,复制出与 dcoker 相关的包,然后直接替换 feeds/packages/ 中对应的文件,这样就可以正常编译了。我使用的历史版本是:https://github.com/coolsnowwolf/packages/commit/3d386440272857c382e43b80112d08f5c1eacfb4    下边是详细步骤:      1、克隆 openwrt-gl-ax1800 仓库,执行 ./scripts/feeds update -a 和 ./scripts/feeds install -a 命令:git clone https://github.com/coolsnowwolf/openwrt-gl-ax1800
cd openwrt-gl-ax1800
./scripts/feeds update -a
./scripts/feeds install -a
      2、提取 docker 相关的包:cd ..
git clone https://github.com/coolsnowwolf/packages
cd packages
git reset --hard 3d386440272857c382e43b80112d08f5c1eacfb4
mkdir -pv ../local/utils/
cp -r utils/containerd ../local/utils/
cp -r utils/docker ../local/utils/
cp -r utils/docker-compose ../local/utils/
cp -r utils/dockerd ../local/utils/
cp -r utils/libnetwork ../local/utils/
cp -r utils/runc ../local/utils/
cp -r utils/tini ../local/utils/
cp -r utils/cgroupfs-mount ../local/utils/      3、将提取的 docker 相关的包复制进 openwrt-gl-ax1800 目录:cd ../openwrt-gl-ax1800/
rm -rf feeds/packages/utils/cgroupfs-mount/
rm -rf feeds/packages/utils/containerd/
rm -rf feeds/packages/utils/docker-ce/
rm -rf feeds/packages/utils/libnetwork/
rm -rf feeds/packages/utils/runc/
rm -rf feeds/packages/utils/tini/

cp -r ../local/utils/* feeds/packages/utils/

cd package/feeds/packages/
rm docker-ce
ln -s ../../../feeds/packages/utils/docker* ./
cd ../../../
      这是我提取的 docker 相关的包:      4、经过以上步骤后,执行 make menuconfig 命令,选择 Utilities---> docker 和 dockerd 已经可以成功编译 docker 了,但是目前编译出的 openwrt 还不能运行 docker ,因为还需要开启内核相关的功能,有一个检测是否可以运行容器的脚本,脚本连接:check-config.sh ,或者使用下载好的:,在 OpenWRT 终端直接执行脚本即可。chmod +x check-config.sh
./check-config.sh      检测结果分为两部分,Generally Necessary 和 Optional Features ,Generally Necessary 的部分必须支持,Optional Features 的部分不支持也可以。      比如检测出 CONFIG_CGROUPS 功能为 missing ,就执行 make menuconfig 命令后,使用 "/" 功能搜索 "CONFIG_CGROUPS" , 按照搜索出的结果进入对应选项中来开启此功能。      
            下图是我执行检测脚本后的结果:            我的 bin/targets/ipq60xx/genericconfig.buildinfo 文件,可作为参考。      5、安装使用 luci-app-dockerman :
cd package
git clone https://github.com/lisaac/luci-app-dockerman
git clone https://github.com/lisaac/luci-lib-docker
cd package
make menuconfig      选择 LuCI ---> 3. Applications---> <*> luci-app-dockerman 执行 make -j1 V=s 命令进行编译。
      6、目前编译好的的 OpenWRT 已经可以运行 docker 了,但是因为 etc/rc.common 文件没有 extra_command 命令,会导致 dockerd 无法开机自启。这个缺陷也已在 lede 仓库中修复了。 可以参考以下的网页修改自己的 package/base-files/files/etc/rc.common 文件,然后再次编译即可。      或者直接使用rc.common文件也可以。https://github.com/coolsnowwolf/lede/issues/7245
https://github.com/coolsnowwolf/lede/commit/22cfbe7faa2e9d32e5c78b273d05cee806861c12      这是我修改后的 rc.common 文件:      7、截图及固件:            AXT1800 固件:https://wwqr.lanzouw.com/iAcAf0pv55tg 密码:1n8e       压缩包解压密码:forum.gl-inet.cn

   




240038901 发表于 2022-10-19 02:52:24

docker可以挂载到u盘或者tf卡吗?设置存储卷到tf卡?

kenysai 发表于 2022-10-19 17:14:58

这个版本带官方UI不??

m0eak 发表于 2022-10-19 17:27:10

kenysai 发表于 2022-10-19 17:14
这个版本带官方UI不??

64位不存在的

zss0hs 发表于 2022-10-19 18:18:19

240038901 发表于 2022-10-19 02:52
docker可以挂载到u盘或者tf卡吗?设置存储卷到tf卡?

我挂到了tf卡上。

240038901 发表于 2022-10-19 22:20:20

zss0hs 发表于 2022-10-19 18:18
我挂到了tf卡上。

docker镜像也是存储在tf卡上吗?就是ram内存少了点,运行5-6个docker估计就顶天了。

H3MKL 发表于 2022-10-20 18:10:54

感谢分享。

luketu 发表于 2022-10-21 11:09:23

谢谢分享 请问这个带docker的固件支持也AX1800吗

mm1052522431 发表于 2022-10-22 22:54:33

厉害了 膜拜一下

yyyxxx1637 发表于 2022-10-23 15:30:59

强!给楼主点赞!
页: [1] 2 3
查看完整版本: AXT1800 64 位 带 docker 固件