Kong-OIDC 插件安装问题

我正在将 Kong-OIDC 插件安装在 Kong docker 容器中,但是遇到以下错误:

Error: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.6.0-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-jwt-0.2.2-0.src.rock - Rockspec format 3.0 is not supported, please upgrade LuaRocks.

似乎其中一个底层依赖项“lua-jesty-jwt”使用的是 Rockpsec format 3.0 版本,该版本不再受支持。 是否有方法解决此问题?

点赞
用户8382591
用户8382591

最新版本的 kong-oidc(1.1.0)对我不起作用,但我能够轻松安装一个较旧的版本(1.0.1)。我确实需要安装另一个库“openssl-devel”(yum install openssl-devel)。

2020-06-02 20:53:56
用户4433104
用户4433104

我更新了Dockerfile使用早期版本的 kong-oidc插件。Dockerfile如下:

从kong:0.14-centos

LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"

RUN yum install -y git unzip && yum clean all

RUN luarocks install kong-oidc 1.0.1

但是运行docker build -t kong:0.14-centos-oidc会返回以下错误:

Error:,无法安装依赖:https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed 安装依赖项:https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed 安装依赖项:https://luarocks.org/luacrypto-0.3.2-2.src.rock - 无法在/usr/local/include中找到openssl/evp.h文件/ curl /in /usr/include中

您可能需要在系统中安装OPENSSL和/或将OPENSSL_DIR或OPENSSL_INCDIR传递给luarocks命令。
示例:luarocks install luacrypto OPENSSL_DIR=/usr/local

因此,我们需要将 RUN yum install openssl-devel -y 添加到Dockerfile。 因此,如果再次运行 docker build 命令,您将收到以下错误:

Build error: Failed compiling object src/lcrypto.oError: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o

因此,我们需要安装 gcc 编译器并将 RUN yum install -y gcc 添加到Dockerfile中。 最终结果为:

FROM kong:0.14-centos

LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"

RUN yum install -y git unzip && yum clean all
RUN yum install -y openssl-devel -y
RUN yum install -y gcc

RUN luarocks install kong-oidc 1.0.1

现在容器可以成功构建,但我认为当前的 kong-oidc 插件不再维护。

更新:请查看此存储库,以获得使用Keycloak的kong-oidc插件的工作示例。

2020-10-08 20:17:42