红河哈尼族彝族自治州网站建设_网站建设公司_需求分析_seo优化
2025/12/30 15:13:29 网站建设 项目流程

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

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询