3

I'm just getting started with the Lua framework called Lapis, but I encountered a problem when I tried to install it into a docker cointainer.

I’m using the official OpenResty image (jessie), and want to extendmy Dockerfile with a “luarocks install lapis” command.

When I try to build the image I get this error:

ERROR: Service 'nginx' failed to build: The command '/bin/sh -c luarocks install lapis' returned a non-zero code: 1

And then this one:

lapis 1.6.0-1 depends on lua-cjson (not installed)
Installing https://luarocks.org/lua-cjson-2.1.0-1.src.rock
lua_cjson.c:1298:13: error: static declaration of 'luaL_setfuncs' follows non-static declaration
static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
            ^

In file included from lua_cjson.c:44:0:
/usr/local/openresty/luajit/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of 'luaL_setfuncs' was here
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
                 ^
Error: Failed installing dependency: https://luarocks.org/lua-cjson-2.1.0-1.src.rock - Build error: Failed compiling object lua_cjson.o
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c lua_cjson.c -o lua_cjson.o

What causes the error?

Gabor
  • 31
  • 2
  • It seems like an issue with old lua-cjson: https://github.com/openresty/docker-openresty/issues/34 Have You tried switching to lua-cjson2 by modifying lapis rockspec? Also, it appears to be fixed in OpenResty 1.11.2.3 – Kamiccolo Jan 17 '18 at 13:05
  • Thank you! I don't think I'm able to modify lapis rockspec file :( 1.11.2.3 version is giving me the same error. – Gabor Jan 17 '18 at 14:34

0 Answers0