curl -fsSL https://raw.gitmirror.com/zhiyu1998/nonebot2-quickly-docker/refs/heads/main/nqd_starter.sh > nqd_starter.sh && chmod 755 nqd_starter.sh && ./nqd_starter.sh 7071
Important
如果你想`默认的话就是7071端口`,否则自行修改,如下修改为`8080端口`作为Onebot的反向连接端口: curl -fsSL https://raw.gitmirror.com/zhiyu1998/nonebot2-quickly-docker/refs/heads/main/nqd_starter.sh > nqd_starter.sh && chmod 755 nqd_starter.sh && ./nqd_starter.sh 8080
Dockerfile 到某个文件夹,运行:docker build -t nonebot2-quickly-docker . --progress=plain
or 如果可以直接拉取镜像,那么就这样运行:
docker pull rrorange/nonebot2-quickly-docker
Onebot (例如 Napcat、Lagrange.Onebot) 反向连接端口是7071,那么就这样运行(如是其他8080就是-p 8080:7071)docker run -d \
--name nonebot2_quickly_docker
-p 7071:7071 \
-v /nb2:/nb2 \
--restart always \
nonebot2-quickly-docker
mkdir -p /nb2
cp -r templates/* /nb2
如果想安装某一个插件,可以使用以下命令进行安装:
docker exec -it nonebot2_quickly_docker pip install nonebot2-plugin-xxx && docker restart nonebot2_quickly_docker
同理,如果需要卸载某个插件,可以使用以下命令进行卸载:
docker exec -it nonebot2_quickly_docker pip uninstall nonebot2-plugin-xxx && docker restart nonebot2_quickly_docker
直接一键脚本:
curl -o napcat.sh https://nclatest.znin.net/NapNeko/NapCat-Installer/main/script/install.sh && sudo bash napcat.sh
官网参考:
Content type
Image
Digest
sha256:1c6954357…
Size
137.7 MB
Last updated
almost 2 years ago
docker pull rrorange/nonebot2-quickly-docker