How to install Lapis into a docker container?
up vote
3
down vote
favorite
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?
docker lua openresty luarocks lapis
add a comment |
up vote
3
down vote
favorite
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?
docker lua openresty luarocks lapis
It seems like an issue with old lua-cjson: 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 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 at 14:34
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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?
docker lua openresty luarocks lapis
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?
docker lua openresty luarocks lapis
docker lua openresty luarocks lapis
asked Jan 16 at 11:47
Gabor
162
162
It seems like an issue with old lua-cjson: 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 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 at 14:34
add a comment |
It seems like an issue with old lua-cjson: 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 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 at 14:34
It seems like an issue with old lua-cjson: 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 at 13:05
It seems like an issue with old lua-cjson: 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 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 at 14:34
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 at 14:34
add a comment |
1 Answer
1
active
oldest
votes
up vote
-1
down vote
Try this docker image with Lapis preinstalled. It's based on Alpine Linux and uses the latest versions of OpenResty and Lapis.
And here is the Dockerfile if you want to reproduce it:
ARG RESTY_IMAGE_BASE="openresty/openresty"
ARG RESTY_IMAGE_TAG="1.13.6.2-alpine"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Dmitry Golovin <dima@golovin.in>"
ARG RESTY_LUAROCKS_VERSION="3.0.2"
RUN apk add --no-cache --virtual .build-deps
perl-dev
openssl-dev
bash
build-base
curl
linux-headers
make
outils-md5
perl
unzip
&& cd /tmp
&& curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& cd luarocks-${RESTY_LUAROCKS_VERSION}
&& ./configure
--prefix=/usr/local/openresty/luajit
--with-lua=/usr/local/openresty/luajit
--lua-suffix=jit-2.1.0-beta3
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
&& make build
&& make install
&& cd /tmp
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& apk add --no-cache --virtual .gettext gettext
&& mv /usr/bin/envsubst /tmp/
&& runDeps="$(
scanelf --needed --nobanner /tmp/envsubst
| awk '{ gsub(/,/, "nso:", $2); print "so:" $2 }'
| sort -u
| xargs -r apk info --installed
| sort -u
)"
&& apk add --no-cache --virtual $runDeps
&& mv /tmp/envsubst /usr/local/bin/
&& luarocks install lapis
&& apk del .build-deps .gettext
&& mkdir /var/www
WORKDIR /var/www
CMD ["lapis", "server"]
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
Try this docker image with Lapis preinstalled. It's based on Alpine Linux and uses the latest versions of OpenResty and Lapis.
And here is the Dockerfile if you want to reproduce it:
ARG RESTY_IMAGE_BASE="openresty/openresty"
ARG RESTY_IMAGE_TAG="1.13.6.2-alpine"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Dmitry Golovin <dima@golovin.in>"
ARG RESTY_LUAROCKS_VERSION="3.0.2"
RUN apk add --no-cache --virtual .build-deps
perl-dev
openssl-dev
bash
build-base
curl
linux-headers
make
outils-md5
perl
unzip
&& cd /tmp
&& curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& cd luarocks-${RESTY_LUAROCKS_VERSION}
&& ./configure
--prefix=/usr/local/openresty/luajit
--with-lua=/usr/local/openresty/luajit
--lua-suffix=jit-2.1.0-beta3
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
&& make build
&& make install
&& cd /tmp
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& apk add --no-cache --virtual .gettext gettext
&& mv /usr/bin/envsubst /tmp/
&& runDeps="$(
scanelf --needed --nobanner /tmp/envsubst
| awk '{ gsub(/,/, "nso:", $2); print "so:" $2 }'
| sort -u
| xargs -r apk info --installed
| sort -u
)"
&& apk add --no-cache --virtual $runDeps
&& mv /tmp/envsubst /usr/local/bin/
&& luarocks install lapis
&& apk del .build-deps .gettext
&& mkdir /var/www
WORKDIR /var/www
CMD ["lapis", "server"]
add a comment |
up vote
-1
down vote
Try this docker image with Lapis preinstalled. It's based on Alpine Linux and uses the latest versions of OpenResty and Lapis.
And here is the Dockerfile if you want to reproduce it:
ARG RESTY_IMAGE_BASE="openresty/openresty"
ARG RESTY_IMAGE_TAG="1.13.6.2-alpine"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Dmitry Golovin <dima@golovin.in>"
ARG RESTY_LUAROCKS_VERSION="3.0.2"
RUN apk add --no-cache --virtual .build-deps
perl-dev
openssl-dev
bash
build-base
curl
linux-headers
make
outils-md5
perl
unzip
&& cd /tmp
&& curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& cd luarocks-${RESTY_LUAROCKS_VERSION}
&& ./configure
--prefix=/usr/local/openresty/luajit
--with-lua=/usr/local/openresty/luajit
--lua-suffix=jit-2.1.0-beta3
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
&& make build
&& make install
&& cd /tmp
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& apk add --no-cache --virtual .gettext gettext
&& mv /usr/bin/envsubst /tmp/
&& runDeps="$(
scanelf --needed --nobanner /tmp/envsubst
| awk '{ gsub(/,/, "nso:", $2); print "so:" $2 }'
| sort -u
| xargs -r apk info --installed
| sort -u
)"
&& apk add --no-cache --virtual $runDeps
&& mv /tmp/envsubst /usr/local/bin/
&& luarocks install lapis
&& apk del .build-deps .gettext
&& mkdir /var/www
WORKDIR /var/www
CMD ["lapis", "server"]
add a comment |
up vote
-1
down vote
up vote
-1
down vote
Try this docker image with Lapis preinstalled. It's based on Alpine Linux and uses the latest versions of OpenResty and Lapis.
And here is the Dockerfile if you want to reproduce it:
ARG RESTY_IMAGE_BASE="openresty/openresty"
ARG RESTY_IMAGE_TAG="1.13.6.2-alpine"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Dmitry Golovin <dima@golovin.in>"
ARG RESTY_LUAROCKS_VERSION="3.0.2"
RUN apk add --no-cache --virtual .build-deps
perl-dev
openssl-dev
bash
build-base
curl
linux-headers
make
outils-md5
perl
unzip
&& cd /tmp
&& curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& cd luarocks-${RESTY_LUAROCKS_VERSION}
&& ./configure
--prefix=/usr/local/openresty/luajit
--with-lua=/usr/local/openresty/luajit
--lua-suffix=jit-2.1.0-beta3
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
&& make build
&& make install
&& cd /tmp
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& apk add --no-cache --virtual .gettext gettext
&& mv /usr/bin/envsubst /tmp/
&& runDeps="$(
scanelf --needed --nobanner /tmp/envsubst
| awk '{ gsub(/,/, "nso:", $2); print "so:" $2 }'
| sort -u
| xargs -r apk info --installed
| sort -u
)"
&& apk add --no-cache --virtual $runDeps
&& mv /tmp/envsubst /usr/local/bin/
&& luarocks install lapis
&& apk del .build-deps .gettext
&& mkdir /var/www
WORKDIR /var/www
CMD ["lapis", "server"]
Try this docker image with Lapis preinstalled. It's based on Alpine Linux and uses the latest versions of OpenResty and Lapis.
And here is the Dockerfile if you want to reproduce it:
ARG RESTY_IMAGE_BASE="openresty/openresty"
ARG RESTY_IMAGE_TAG="1.13.6.2-alpine"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Dmitry Golovin <dima@golovin.in>"
ARG RESTY_LUAROCKS_VERSION="3.0.2"
RUN apk add --no-cache --virtual .build-deps
perl-dev
openssl-dev
bash
build-base
curl
linux-headers
make
outils-md5
perl
unzip
&& cd /tmp
&& curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& cd luarocks-${RESTY_LUAROCKS_VERSION}
&& ./configure
--prefix=/usr/local/openresty/luajit
--with-lua=/usr/local/openresty/luajit
--lua-suffix=jit-2.1.0-beta3
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
&& make build
&& make install
&& cd /tmp
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
&& apk add --no-cache --virtual .gettext gettext
&& mv /usr/bin/envsubst /tmp/
&& runDeps="$(
scanelf --needed --nobanner /tmp/envsubst
| awk '{ gsub(/,/, "nso:", $2); print "so:" $2 }'
| sort -u
| xargs -r apk info --installed
| sort -u
)"
&& apk add --no-cache --virtual $runDeps
&& mv /tmp/envsubst /usr/local/bin/
&& luarocks install lapis
&& apk del .build-deps .gettext
&& mkdir /var/www
WORKDIR /var/www
CMD ["lapis", "server"]
edited Nov 11 at 7:27
answered Nov 9 at 7:28
CYB3R
180417
180417
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48280544%2fhow-to-install-lapis-into-a-docker-container%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It seems like an issue with old lua-cjson: 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 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 at 14:34