当前位置: 首页 > news >正文

centos系统上docker和 dify生成openAI_API_compatible插件相关记录

mkdir -p /opt/dify-plugin-build

cd /opt/dify-plugin-build

 

[root@localhost dify-plugin-build]# docker pull python:3.10-slim

3.10-slim: Pulling from library/python

1733a4cd5954: Pull complete

9fd9e26f8f28: Pull complete

004f0aa18a07: Pull complete

7bceabe27cdf: Pull complete

Digest: sha256:fb1feae978f1729094eb0405e5f9564e55b2b3b24db3261d30ba4f22c5001a8a

Status: Downloaded newer image for python:3.10-slim

docker.io/library/python:3.10-slim

[root@localhost dify-plugin-build]#

 

[root@localhost dify-plugin-build]# docker run -it --rm \

>   --network host \

>   -v /opt/dify-plugin-build:/work \

>   python:3.10-slim \

>   bash

root@localhost:/#

 

root@localhost:/# cd /work

root@localhost:/work# ls

langgenius-openai_api_compatible_0.0.27.difypkg

root@localhost:/work#

 

root@localhost:/work# apt update

Hit:1 http://deb.debian.org/debian trixie InRelease

Get:2 http://deb.debian.org/debian trixie-updates InRelease [47.3 kB]

Get:3 http://deb.debian.org/debian-security trixie-security InRelease [43.4 kB]

Get:4 http://deb.debian.org/debian trixie/main amd64 Packages [9670 kB]

Get:5 http://deb.debian.org/debian trixie-updates/main amd64 Packages [5412 B]

Get:6 http://deb.debian.org/debian-security trixie-security/main amd64 Packages [93.7 kB]

Fetched 9860 kB in 6s (1525 kB/s)                                                                                                                  

All packages are up to date.    

root@localhost:/work#

 

2️⃣ 安装 git

apt install -y git

root@localhost:/work# git --version

git version 2.47.3

root@localhost:/work#

root@localhost:/work# git clone https://github.com/langgenius/dify-plugin-repackaging.git

https://github.com/junjiem/dify-plugin-repackaging.git

root@localhost:/work# apt install -y wget unzip

方式 B(更稳妥):下载 zip 解压

apt update

apt install -y wget unzip

wget https://github.com/junjiem/dify-plugin-repackaging/archive/refs/heads/main.zip

unzip main.zipmv dify-plugin-repackaging-main dify-plugin-repackaging

wget https://github.com/junjiem/dify-plugin-repackaging/archive/refs/heads/main.zip

下载速率有点慢

wget https://github.com/junjiem/dify-plugin-repackaging/archive/refs/heads/main.zip

root@localhost:/work# unzip main.zip

Archive:  main.zip

8f64342522b0592f1e0a49d189936caf21c0f92f

   creating: dify-plugin-repackaging-main/

   creating: dify-plugin-repackaging-main/.github/

   creating: dify-plugin-repackaging-main/.github/ISSUE_TEMPLATE/

  inflating: dify-plugin-repackaging-main/.github/ISSUE_TEMPLATE/bug_report.yml  

  inflating: dify-plugin-repackaging-main/.github/ISSUE_TEMPLATE/config.yml  

root@localhost:/work# ls

dify-plugin-repackaging-main  langgenius-openai_api_compatible_0.0.27.difypkg  main.zip

root@localhost:/work# mv dify-plugin-repackaging-main dify-plugin-repackaging

root@localhost:/work# cd dify-plugin-repackaging

root@localhost:/work/dify-plugin-repackaging# ls

Dockerfile  dify-plugin-darwin-amd64  dify-plugin-linux-amd64  images

README.md   dify-plugin-darwin-arm64  dify-plugin-linux-arm64  plugin_repackaging.sh

root@localhost:/work/dify-plugin-repackaging#

给脚本加执行权限(第一次用)

chmod +x plugin_repackaging.sh

ERROR: No matching distribution found for dify-plugin==0.7.0

[notice] A new release of pip is available: 23.0.1 -> 25.3

[notice] To update, run: pip install --upgrade pip

Pip download failed.

root@localhost:/work/dify-plugin-repackaging# ls

Dockerfile  dify-plugin-darwin-amd64  dify-plugin-linux-amd64  images                                   plugin_repackaging.sh

README.md   dify-plugin-darwin-arm64  dify-plugin-linux-arm64  langgenius-openai_api_compatible_0.0.27

root@localhost:/work/dify-plugin-repackaging#

root@localhost:/work/dify-plugin-repackaging#

root@localhost:/work/dify-plugin-repackaging#

 

解决上面的问题

二、准备新的容器(Python 3.11

 

拉取 3.11 镜像:

docker pull python:3.11-slim

启动新容器,并挂载你的插件工作目录:

docker run -it --rm --network host -v /opt/dify-plugin-build:/work python:3.11-slim bash

cd /work

apt-get update

apt-get install -y unzip

 

一、安装 unzip 工具

在容器内执行以下命令,安装 unzip 工具:

apt-get update

apt-get install -y unzip

这将确保你的容器具备解压工具。


 

二、重新执行插件重打包命令

安装完 unzip 后,直接运行你的重打包命令:

./plugin_repackaging.sh -p manylinux2014_x86_64 -s linux-amd64 local /work/langgenius-openai_api_compatible_0.0.27.difypkg

sh plugin_repackaging.sh local langgenius-openai_api_compatible_0.0.27.difypkg

## 执行完成后会生成一个包含所有依赖的插件包:

langgenius-openai_api_compatible_0.0.27-offline.difypkg

重新打开启动

docker run -it --rm \

  --network host \

  -v /opt/dify-plugin-build:/work \

  python:3.12-slim \

  bash

python --version

 

# 安装 unzip

apt-get update

apt-get install -y unzip

# 确保 pip 已经安装

python -m ensurepip --upgrade

cd /work

ls

 

# 运行插件打包脚本

./plugin_repackaging.sh -p manylinux2014_x86_64 -s linux-amd64 local /work/langgenius-openai_api_compatible_0.0.27.difypkg

ls /work

Ls

# 运行插件打包脚本

./plugin_repackaging.sh -p manylinux2014_x86_64 -s linux-amd64 local /work/langgenius-openai_api_compatible_0.0.27.difypkg

root@localhost:/work/dify-plugin-repackaging# ls /work

dify-plugin-repackaging  langgenius-openai_api_compatible_0.0.27.difypkg  main.zip    只看到这些

ls /work/dify-plugin-repackaging

./plugin_repackaging.sh -p manylinux2014_x86_64 -s linux-amd64 local /work/langgenius-openai_api_compatible_0.0.27.difypkg

pip install -r /work/dify-plugin-repackaging/requirements.txt

pip install dify-plugin

http://www.zskr.cn/news/181440.html

相关文章:

  • 为什么微信分享成功后还能跳回app 但是safari打不开app,说明 微信分享走的是微信的URL Scheme ,Universal Link是不通的
  • 合规是企业zui长久的保护伞
  • 2025五面加工立卧复合加工中心生产厂家应用价值分析 - 栗子测评
  • 如何将下载的Jar包放到本地的Maven仓库?
  • GitHub CI/CD集成Miniconda环境进行自动化测试
  • 2025年中国闭式冷却塔行业TOP5推荐:节能环保型、节能型定制实力厂家有哪些? - 工业推荐榜
  • Miniconda-Python3.9安装全过程录屏图文教程(新手必看)
  • Markdown数学公式渲染:Miniconda-Python3.9镜像KaTeX支持
  • 大模型微调完全指南:从入门到实践,值得收藏的教程
  • 利用Miniconda-Python3.9镜像快速构建可复现的AI开发环境
  • AI开发者必备技能:使用Miniconda创建独立Python环境实战
  • 小迪安全_第4天:基础入门-30余种加密编码进制Web数据库系统代码参数值|小迪安全笔记|网络安全|
  • GitHub Action缓存依赖:Miniconda-Python3.9镜像加速CI构建
  • Jupyter Notebook远程访问配置指南(Miniconda-Python3.9镜像适用)
  • Bagging vs Boosting:谁才是最强“抱团”算法?
  • 零基础学黑客技术:一文帮你避开90%的坑,快速掌握高效进阶学习路径!
  • 2025年坡口机厂家实力推荐榜:深圳凯德盛,管道/内涨式/钢板/便携式坡口机全系供应 - 品牌推荐官
  • 模型部署---生产
  • Jmeter 接口测试-websocket实例
  • 2025洛阳汽车窗膜服务TOP5权威推荐:深度测评指南 - 工业推荐榜
  • Markdown+Jupyter:用Miniconda-Python3.9打造优雅的技术博客写作环境
  • 2025 北京眼镜城配镜指南:5 家高口碑店铺实测 专业与性价比双选 - 品牌推荐排行榜
  • 【onnx-mlir】DialectBuilder设计学习
  • 清华源、阿里云源哪个更快?Miniconda pip源切换实测对比
  • 别再当“RAG复读机“了!智能体让大模型开发“智商“飙升,小白必看!
  • Flux 2:并不惊艳,但可能是开源图像模型的重要转折点
  • 计算机毕业设计springboot在线美食点评系统 基于SpringBoot的云端舌尖口碑平台 SpringBoot驱动的网络餐饮体验分享社区
  • 2025宁波液压管件出口商/英文网站液压管件工厂测评 - 栗子测评
  • highgo DB中数据库对象,模式,用户,权限之间的关系
  • Inter的电脑使用GPU加速训练