pmOS 安装 docker 的折腾记录

License: CC BY-NC-SA 4.0

前言

最后还是失败了。

哈哈哈终于成功了!

失败的尝试

docker 启动不起来,手动运行 sudo dockerd 就会报错

failed to start daemon: Error initializing network controller: error creating default "bridge" network: Failed to Setup IP tables: Unable to enable NAT rule:  (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE: Warning: Extension MASQUERADE revision 0 not supported, missing kernel module?
iptables v1.8.10 (nf_tables):  RULE_INSERT failed (No such file or directory): rule in chain POSTROUTING
 (exit status 4))

看到了

missing kernel module?

于是怀疑是内核的问题。

(说句闲话:前前后后编译了大概三次内核……)

参考了这篇

先调整内核参数。

(设置镜像源部分省略)

pmbootstrap kconfig edit linux-postmarketos-qcom-msm8998

然后开始编译。我的破手机要编译一个小时才能编译好自己的内核,因此我加上了 -t 3600。如果能在 15 分钟内编译好就不用加这个参数。

pmbootstrap -t 3600 build --force linux-postmarketos-qcom-msm8998

然后还是没启动成功。

成功的尝试

参考这篇,一步到位。

省流:

(以下均为 root 用户运行)

apk add iptables-legacy

# Remove the existing iptables binary
rm /sbin/iptables

# Create a symlink to iptables-legacy
ln -s /sbin/iptables-legacy /sbin/iptables

#Reboot
reboot

然后就能用了。

posted @ 2024-07-19 11:46  383494  阅读(7)  评论(0编辑  收藏  举报