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?










share|improve this question






















  • 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

















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?










share|improve this question






















  • 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















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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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




















  • 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














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"]





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    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

























    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"]





    share|improve this answer



























      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"]





      share|improve this answer

























        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"]





        share|improve this answer














        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"]






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 11 at 7:27

























        answered Nov 9 at 7:28









        CYB3R

        180417




        180417






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly