我正在将Kong-OIDC插件安装在Kong docker容器中,并收到以下错误:
错误:安装依赖项失败:https://luarocks.org/lua-resty-openidc-1.6.0-1.src.rock -安装依赖项失败:https://luarocks.org/lua-resty-jwt-0.2.2-0.src.rock -不支持Rockspec format 3.0,请升级LuaRocks。
似乎底层依赖“lua-jesty jwt”之一使用的是Rockpsec format 3.0版本,该版本不再受支持。有没有办法绕过这个问题?
发布于 2020-10-09 04:17:42
我用以前版本的kong-oidc插件更新了Dockerfile。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 luarocks install kong-oidc 1.0.1但是运行docker build -t kong:0.14-centos-oidc会返回以下错误:
Error: 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 - Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: 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插件。
更新:查看this repository,获取使用Keycloak的kong-oidc插件的工作示例。
发布于 2020-06-03 04:53:56
最新版本的kong-oidc (1.1.0)不适用于我,但我可以安装一个较旧的版本(1.0.1),没有太多问题。我确实需要安装一个额外的库"openssl-devel“(yum install openssl-devel)。
https://stackoverflow.com/questions/62157684
复制相似问题