Docker安装
Docker官方和国内daocloud都提供了一键安装的脚本,使得Docker的安装更加便捷。
官方的一键安装方式:
1
| curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
|
国内 daocloud一键安装命令:
1
| curl -sSL https://get.daocloud.io/docker | sh
|
拉取项目(三选一)
1 2 3 4 5 6 7 8
| // 原版yunzai-bot(似乎不再维护了) git clone --depth=1 -b main https://gitee.com/Le-niao/Yunzai-Bot.git
// 摩拉版yunzai-bot(oicq) git clone --depth=1 -b main https://gitee.com/Rrrrrrray/Yunzai-Bot.git
// 喵版yunzai-bot(icqq) git clone --depth=1 -b main https://gitee.com/yoimiya-kokomi/Yunzai-Bot.git
|
启动容器(这里拉取我制作的镜像)
1 2 3 4 5
| //amd64 docker run -itd --name Yunzai-Bot --net=host -v <项目目录>:/root/Yunzai-Bot yiyule10/yunzai-bot:amd64
//arm64 docker run -itd --name Yunzai-Bot --net=host -v <项目目录>:/root/Yunzai-Bot yiyule10/yunzai-bot:arm64
|
<项目目录>填写项目拉取到本地的地址
例如:
我的设备CPU是X86架构,在opt目录拉取了项目,启动容器的指令是
1
| docker run -itd --name Yunzai-Bot --net=host -v /opt/Yunzai-Bot:/root/Yunzai-Bot yiyule10/yunzai-bot:amd64
|
进入容器
1
| docker exec -it Yunzai-Bot /bin/bash
|
安装项目依赖
1 2
| cd /root/Yunzai-Bot pnpm install -P
|
运行
前台运行(首次运行按提示输入登录)
后台运行Yunzai-Bot和停止Yunzai-Bot
运行(推荐,首次运行选择“前台运行”)
停止