vwout / docker-openluup

Dockerized openLuup environment with AltUI
https://hub.docker.com/r/vwout/openluup/
Apache License 2.0
3 stars 2 forks source link

Unable to install Luarocks LuaExpat #11

Open nodecentral opened 1 year ago

nodecentral commented 1 year ago

I’m looking to install an xml parser in support of require("lxp/lom") and i came across this to use luarocks, (https://community.ezlo.com/t/lua-module-lxp-not-found/191497) but I’ve not been able to get it to work , please see below..

To access the openluup docker command line i entered docker exec -it openluup /bin/sh and then ran luarocks install LuaExpat which returned the following error messages..

Warning: The directory '/root/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /usr/local/bin/luarocks with sudo, you may want sudo's -H flag.
Installing https://luarocks.org/luaexpat-1.5.1-1.src.rock

Error: Could not find header file for EXPAT
  No file expat.h in /usr/local/include
  No file expat.h in /usr/include
  No file expat.h in /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

Looking at whoiam I’m logged in as root, and can see luarocks is installed and where it sits..

/etc/cmh-ludl # luarocks --version
/usr/local/bin/luarocks 3.0.0
LuaRocks main command-line interface

I’ve tried various things found online, some below, but nothing has worked so far..

USER=root /usr/bin/luarocks install LuaExpat
USER=root /usr/local/bin/luarocks install LuaExpat

Just wondering if you had any ideas..

vwout commented 1 year ago

Assuming you use my Alpine image as basis (since the Debian based image does not contain LuaRocks at all): in order to keep the image as small as possible, all libraries, files, etc. that are only needed during image creation are removed as soon as possible. This means that all development headers that are needed to build libexpat, do not exist in the image,

LuaExpat should however already be available, in both images (see Alpine Dockerfile or Debian Dockerfile.

Both require("lxp") and require("lxp/lom") work on both images.

nodecentral commented 1 year ago

Many thanks @vwout ,

I’m using your alpine image, and all the above in my opening post, came from that command line...

If it’s supposed to be there already i’ll try again..