Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help request: How to Add New Luarocks Dependencies in APISIX Docker Environment? #11945

Open
amyrprv opened this issue Feb 3, 2025 · 4 comments
Labels
question label for questions asked by users

Comments

@amyrprv
Copy link

amyrprv commented Feb 3, 2025

Description

I want to use additional dependencies from Luarocks while running APISIX in a Docker environment using the official images. What is the best way to install and include these dependencies?

Environment

  • APISIX version (run apisix version): 3.9.1 debian docker
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Apache APISIX backlog Feb 3, 2025
@dosubot dosubot bot added the question label for questions asked by users label Feb 3, 2025
@mikyll
Copy link
Contributor

mikyll commented Feb 3, 2025

One way to do so is by writing a custom Docker image which inherits from an official image, and then run luarocks install <rock_name>.

Example (based on apache/apisix:3.11.0-debian):

FROM apache/apisix:3.11.0-debian

USER root

# Install luarocks (and/or whatever additional tool you need)
RUN apt-get update && apt-get install -y luarocks

RUN luarocks install <rock_name>

EXPOSE 9080 9443

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD ["docker-start"]

STOPSIGNAL SIGQUIT

@amyrprv
Copy link
Author

amyrprv commented Feb 4, 2025

I am trying to install LuaSOAP I get the below error, It seems the library is dependent on luaexpat, and installing luaexpat will fail.

root@98955587e0ca:/usr/local/apisix# luarocks install luasoap
Installing https://luarocks.org/luasoap-4.0.2-1.rockspec
Missing dependencies for luasoap 4.0.2-1:
   luaexpat >= 1.1.0-3 (not installed)
   luasocket >= 2.0.2-1 (not installed)
   http-digest >= 1.2.2-1 (not installed)

luasoap 4.0.2-1 depends on luaexpat >= 1.1.0-3 (not installed)
Installing https://luarocks.org/luaexpat-1.5.2-1.src.rock

Error: Failed installing dependency: https://luarocks.org/luaexpat-1.5.2-1.src.rock - Could not find header file for EXPAT
  No file expat.h in /usr/local/include
  No file expat.h in /usr/include
You may have to install EXPAT in your system and/or pass EXPAT_DIR or EXPAT_INCDIR to the luarocks command.
Example: luarocks install luaexpat EXPAT_DIR=/usr/local

@Revolyssup
Copy link
Contributor

@amyrprv Try installing libexpat1-dev or expat with the package manager. The C library is missing. Btw what is your exact use case? Why do you want to install this library ?

@amyrprv
Copy link
Author

amyrprv commented Feb 5, 2025

@Revolyssup I'm creating a custom plugin to transform SOAP upstream into JSON. I'm currently using the body-transformer plugin, but I've encountered issues in production: the upstream response isn't converted to JSON in hight load with the rate of 1.5 percent of the total tps, and the template-based approach isn't very convenient. I’m looking for a more reliable solution to handle the SOAP-to-JSON transformation.

also after installing libexpat1-dev from apt I get error: error Expat 2.4 or newer is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question label for questions asked by users
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants