gpt4 book ai didi

docker - 如何在使用Docker安装的Kong中添加社区插件

转载 作者:行者123 更新时间:2023-12-02 18:50:34 28 4
gpt4 key购买 nike

我们正在尝试安装社区插件香港服务虚拟化。由于我是kong的新手,所以无法找到给出详细安装步骤的解决方案,例如在何处以及如何添加该插件,如何编辑kong.conf等。任何人都可以帮助我解决该问题。
提前致谢。

最佳答案

您可以使用luarocks在kong中安装任何插件

例如,这是一个示例docker文件

FROM kong
ENV LUA_PATH /usr/local/share/lua/5.1/?.lua;/usr/local/kong-oidc/?.lua;;
# For lua-cjson
ENV LUA_CPATH /usr/local/lib/lua/5.1/?.so;;

# Install unzip for luarocks, gcc for lua-cjson
RUN yum install -y unzip gcc
RUN luarocks install luacov

这是oidc插件的一个示例: https://github.com/nokia/kong-oidc

我们可以使用 luarocks install <plugin name>安装插件

构建您自己的自定义docker镜像并将kong镜像用作基本docker镜像。

这里整个示例工作 Dockerfile
FROM kong:latest  
USER root
RUN apk update && apk add git unzip luarocks
RUN luarocks install kong-oidc
USER kong

关于docker - 如何在使用Docker安装的Kong中添加社区插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62210475/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com