Centos7.9中使用Docker安装云崽机器人
Centos7.9中使用Docker安装云崽机器人
前面我写了如何普通版搭建云崽教程,今天我们来使用docker来安装,感谢docker镜像源作者:如青桑(QQ: 1666633887)
普通版教程:https://blog.hanhanz.top/?p=309
镜像源地址:https://hub.docker.com/r/moeta233/yunzai-chatgpt
Ubuntu版docker安装云崽教程:https://err0r.top/article/Yunzai-chatgptPlugin/
使用docker的前提是你得有docker,怎么看你是否已经安装了呢,在终端输入docker version ,如果提示未找到命令,那就是没安装,如果有输出内容,那就太棒啦,你可以跳过安装docker部分啦~请前往下方安装云崽部分
前提条件
Docker要求系统为64位、Linux系统内核版本为3.8以上
cat /etc/redhat-release
uname -r

参考我的系统是Centos7.9,内核版本为3.10,是64位的。
安装Docker
安装软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
设置yum源
#二选一,也可以不选
yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo(中央仓库)
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(阿里仓库)
docker的版本选择和安装
查看版本
yum list docker-ce --showduplicates | sort -r

这里我选择安装第一个23.0.1的版本
选择好版本进行安装
yum -y install docker-ce-23.0.1

不报错就说明安装好了
启动docker
systemctl start docker
检查已安装的docker
docker version

设置开机自启
systemctl enable docker
安装云崽
上面我们安装好了docker,现在可以安装云崽了
镜像介绍
一个开箱即用的云崽Bot,集成锅巴插件和
ChatGPT插件。已配置好所有依赖和
ffmpeg。默认用户:root,密码:password。请务必在连接后使用
passwd root,更改root账户的密码。
使用方法
请直接运行:
docker run -it -p {SSH端口}:22 -p {锅巴端口}:50831 --name {容器名称} moeta233/yunzai-chatgpt
例如:
docker run -it -p 22:22 -p 50831:50831 --name yunzai moeta233/yunzai-chatgpt
国内镜像
镜像较大,建议使用国内镜像:registry.cn-beijing.aliyuncs.com/moeta/yunzai-chatgpt
docker run -it -p 22:22 -p 50831:50831 --name yunzai registry.cn-beijing.aliyuncs.com/moeta/yunzai-chatgpt
运行之后先是会拉取镜像,一切正常的话,会提示你配置QQ号还有密码以及登录协议主人QQ等配置项,登录成功后会出现下面界面,这样就算成功了,在QQ聊天界面给机器人发送#重启就可以后台运行了,配置ChatGPT插件的话,私聊机器人#锅巴登录去锅巴里面进行配置,当然如果你是大神或者你就要自己配置,请参考我的另一篇教程:https://blog.hanhanz.top/?p=309


后台运行的方法
第一种
发送重启后,直接
Ctrl+P+Q就退出docker了,后台也会继续运行第二种
这种方法适用于你的QQ号登录没有出现问题的时候
发送重启后,会出现下面界面,然后输入
exit退出docker,然后发送docker start yunzai命令运行刚刚创建的docker容器,如果要查看日志的话,输入docker attach yunzai进入查看(只能查看attach以后的日志,我本人docker小白,不太懂docker,可能也有其他方法,可以指正)

教程到这结束了。
其他问题
当云崽退出后会进入bash命令行,因此可能不支持意外退出自动重启,但容器开启会自动运行。您可以在 /app/yunzai.sh 自定义启动脚本。
如果您初次配置出现问题,可以删除容器重建,或重新启动容器并立刻附加,以容器名yunzai为例:
Linux:
docker start yunzai && docker attach yunzai
Windows Powershell:
docker start yunzai; docker attach yunzai
Dockerfile
FROM node:bullseye
VOLUME ["/app"]
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && mkdir -p /app
WORKDIR /app
RUN apt-get update && apt-get install -y curl wget vim git cmake redis-server dialog openssh-server ssh vim
RUN echo "root:password" | chpasswd \
&& sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's/^#\(PermitRootLogin.*\)/\1/' /etc/ssh/sshd_config \
&& /etc/init.d/ssh start
EXPOSE 22
RUN npm install pnpm --registry=https://registry.npm.taobao.org -g
RUN git clone --depth=1 -b main https://gitee.com/yoimiya-kokomi/Yunzai-Bot.git
WORKDIR /app/Yunzai-Bot
RUN pnpm install -P
RUN git clone --depth=1 https://gitee.com/guoba-yunzai/guoba-plugin.git ./plugins/Guoba-Plugin/
RUN pnpm install --filter=guoba-plugin
EXPOSE 50831
RUN git clone --depth=1 https://gitee.com/ikechan/chatgpt-plugin.git ./plugins/chatgpt-plugin/
WORKDIR /app/Yunzai-Bot/plugins/chatgpt-plugin
RUN pnpm install
RUN apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libgbm-dev libnss3 \
ca-certificates fonts-liberation lsb-release xdg-utils wget ttf-wqy-zenhei
RUN fc-cache -fv
WORKDIR /usr/share/
ADD https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz /usr/share/
RUN tar -xf /usr/share/ffmpeg-release-amd64-static.tar.xz \
&& mv /usr/share/ffmpeg-6.0-amd64-static /usr/share/ffmpeg \
&& rm -rf /usr/share/ffmpeg-release-amd64-static.tar.xz \
&& chmod 755 /usr/share/ffmpeg/ffmpeg \
&& chmod 755 /usr/share/ffmpeg/ffprobe \
&& ln -s /usr/share/ffmpeg/ffmpeg /usr/bin/ffmpeg \
&& ln -s /usr/share/ffmpeg/ffprobe /usr/bin/ffprobe \
&& chmod 755 /usr/bin/ffmpeg \
&& chmod 755 /usr/bin/ffprobe
WORKDIR /app/Yunzai-Bot
COPY ./yunzai.sh /app/yunzai.sh
ENTRYPOINT [ "/app/yunzai.sh" ]
启动脚本 yunzai.sh
#!/bin/bash
service ssh start
echo -e "\033[0;96m登录后您可以在QQ发送 #重启 命令使Bot转入后台,进入终端。\033[0m"
cd "/app/Yunzai-Bot" || exit
node app
bash
Centos7.9中使用Docker安装云崽机器人的更多相关文章
- 安装云崽Bot+GPT3插件
安装云崽Bot+GPT3插件 这次我们来搭建云崽Bot,云崽Bot其实是一个用于原神的机器人,不过众多大佬开发出了很多有趣的插件供我们使用,这次我们就是用其中的一个插件Chat-gpt(其不是正宗的C ...
- CentOS中利用Docker安装RabbitMQ
CentOS中利用Docker安装RabbitMQ 1.拉取镜像(带管理平台) #docker pull rabbitmq:3.7.7-management 2.启动容器: #docker run - ...
- CentOS中利用Docker安装Redis
CentOS中利用Docker安装Redis 1.拉取镜像 #docker pull redis:4.0.10 2.加载镜像 #docker run -p 6379:6379 --name test- ...
- 阿里云CentOS7.3服务器通过Docker安装Nginx
前言 小编环境: 阿里云CentOS7.3服务器 docker 下面分享一次小编在自己的阿里云CentOS7.3服务器上使用Docker来安装Nginx的一次全过程 温馨小提示: 如果只是希望单纯使用 ...
- CentOS 中利用docker安装MySQL
1.前提条件 centos7 且内核版本高于3.10, 可通过命令: uname -r 查看内核版本 2.利用yum 安装docker 安装一些必要的系统工具: sudo yum install -y ...
- 阿里云服务器CentOS7.3上通过Docker安装MySQL
一.前言 我的服务器环境: CentOS7.3 Docker Portainer -> Docker可视化界面工具 二.拉取mysql镜像 这里我安装的是mysql5.7版本 docker pu ...
- Docker - 在CentOS7.5中升级Docker版本
1 - 检查当前版本 [root@localhost ~]# uname -a Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu ...
- CentOS7.X中使用yum安装nginx的方法
nginx官方文档说明:http://nginx.org/en/linux_packages.html#RHEL-CentOS 一.安装前准备: yum install yum-utils 二.添加源 ...
- Kubernetes+Docker的云平台在CentOS7系统上的安装
Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...
- 在 Docker 的 CentOS7 镜像 中安装 mysql
在 Docker 的 CentOS7 镜像 中安装 mysql 本来以为是个很简单的过程居然折腾了这么久,之前部署云服务器时也没有好好地记录,因此记录下. 特别提醒:本文的操作环境是在 Docker ...
随机推荐
- Optional类与使用==判断null有什么区别?使用Optional类有什么优势?
1.使用object==null的例子 2.null带来的问题 3.其他语言中null的处理(替代) 4.Java8的Optional类 4.1 这样做有什么好处呢? 4.2 引入Optional类的 ...
- Jetpack compose初尝试
2021/07/29 Jetpack compose1.0正式发布,已经可以在生产环境中使用了. 下面的内容为根据官方教程尝试的总结,上手没难度,而且也不需要配置什么环境. Android 开发者 ...
- Django框架搭建web项目(一)
建议查看官方文档:https://docs.djangoproject.com/zh-hans/4.0/intro/tutorial01/ 1.本地安装python环境(略) 2.本地安装Django ...
- spring-boot-starter-webflux 与spring-cloud-starter-openfeign冲突
Thu Oct 22 17:16:01 CST 2020 [3be84a1c-14] There was an unexpected error (type=Internal Server Error ...
- linux 命令下载文件
系统 ubuntu :若提示没有找到命令 请自行下截安装 sz 命令发送文件到本地:# sz filename rz命令本地上传文件到服务器:# rz执行该命令后,在弹出框中选择要上传的文件即可.
- Python自学day03
1.数据类型 int 1,2,3用于计算 bool True,False用于判断 str 存储少量数据,用于操作 list 存储大量数据 [1,2,3,'a ...
- java获取当前类的绝对路径
转自: http://blog.csdn.net/elina_1992/article/details/47419097 1.如何获得当前文件路径 常用: (1).Test.class.getRe ...
- xcodeproj Building for iOS, but the linked and embedded framework ‘xxx.framework’ was built for iOS + iOS Simulator.
一.报错 报错内容大致如下 /xxxx/xxx.xcodeproj Building for iOS, but the linked and embedded framework 'xxx.frame ...
- win服务项因各种原因出问题,删除注册表服务项
win7系统,可以cmd–>sc delete 服务名称win10计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services 删除相关服务即 ...
- 使用 ww.cad 完成dwg文件转shp(包含所有属性)
单纯使用ArcEngine提供的接口读取dwg数据转shp存在众多属性无法读取的情况(最直观的 南方cass生产的dwg文件有SOUTH这一字段,为目标要素的类型) private void Conv ...