如题功能

拆解

  • 安装linux
  • 安装docker
  • 安装机器人
  • 通信

当前状态

华为手机 mate30,IT知识若干

安装linux

git项目:https://github.com/termux/termux-app
APK:下载地址

安装APK之后自带 alpine3.10 系统

注意这个3.10,很重要

进入app

2025-02-23T14:33:00.png

# 选择setting,设置端口转发,方便电脑直连ssh
tcp:8022:22,tcp:8080:80,tcp:8088:8088,tcp:5300:5300

启动 Launch

输入 root 进入系统后,使用passwd修改密码,一定要修改!(我使用的时候不修改不能设置ssh)
然后 修改/etc/ssh/sshd_config
# 允许用户通过密码登录
PasswordAuthentication yes
# 启动 SSH 服务
rc-service sshd start
# 加入开机启动
rc-update add sshd
新增用户(可选)
# Alpine 默认使用 "wheel" 组作为管理员组
adduser myuser wheel
# 安装 sudo(Alpine 默认未安装)
apk add sudo
# 编辑 sudoers 文件,允许 wheel 组免密码使用 sudo
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

安装 Docker

apk update && apk add docker
#这里出现了错误,不是网络问题,也不是签名问题,是源的问题。
#默认用的edge的源应该改成对应版本号,如3.10的源
/etc/apk/repositories
https://mirrors.aliyun.com/alpine/v3.10/main
https://mirrors.aliyun.com/alpine/v3.10/community

#docker安装好之后加入开机启动
rc-update add docker boot

扩容 root

2025-02-23T14:43:48.png

#默认只有4G 太小了
#安装工具
apk add e2fsprogs e2fsprogs-extra parted
#开始扩容
parted /dev/sda
(parted) resizepart 1 50%  # 将分区 1 扩展到磁盘一半,但是实测不行,具体看下图
(parted) quit
# 更新
resize2fs /dev/sda1

2025-02-23T14:44:48.png

安装gewechat、LangBot

拉取镜像

docker pull registry.cn-chengdu.aliyuncs.com/wuhuan123/gewechat:latest
docker tag registry.cn-chengdu.aliyuncs.com/wuhuan123/gewechat:latest gewe2
docker pull docker.1ms.run/rockchin/langbot:latest
docker tag docker.1ms.run/rockchin/langbot:latest rockchin/langbot:latest
docker network create langbot-network

配置docker-compose.yml langbot

version: "3"

services:
  langbot:
    image: rockchin/langbot:latest
    container_name: langbot
    volumes:
      - ./data:/app/data
      - ./plugins:/app/plugins
    restart: on-failure
    ports:
      - 5300:5300
      - 2280-2290:2280-2290
    networks:
      - langbot-network
networks:
  langbot-network:
    external: true

配置docker-compose.yml gewe

version: "3"

services:
 gewe:
    image: gewe2:latest
    container_name: gewe
    stdin_open: true
    tty: true
    privileged: true
    ports:
      - "2531:2531"
      - "2532:2532"
    networks:
      - langbot-network

networks:
  langbot-network:
    external: true

最后

#手机跑不了langbot的docker-compose,报错Error response from daemon: cgroups: cannot find cgroup mount destination: unknown
# 升级系统 从3.10 升级到3.14 纯docker运行