From 10a44228e8d8482a9b5b9a7385f513c0c1f7d854 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Wed, 18 Jan 2023 21:29:54 +0100 Subject: [PATCH] fix(?): use nix to install lua and lua-language-server --- Dockerfile | 31 ++----------------------------- lua/entrypoint.lua | 1 - 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07f1eba..b5674dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,7 @@ # TODO: Use official alpine image with pinned package versions when lua-language-server is available -FROM lspcontainers/lua-language-server:latest AS lua +FROM nixos/nix:2.13.1 AS sumneko-lint -ENV LUA_VERSION="5.1.5" -ENV LUA_SHA1_CHECKSUM="b3882111ad02ecc6b972f8c1241647905cb2e3fc" - -RUN set -ex \ - && cat /etc/*-release \ - && apk upgrade \ - && apk add --no-cache readline-dev \ - && apk add --no-cache --virtual .build-deps \ - make \ - gcc \ - libc-dev \ - ncurses-dev \ - && wget -cq https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz \ - -O lua.tar.gz \ - && [ "$(sha1sum lua.tar.gz | cut -d' ' -f1)" = "${LUA_SHA1_CHECKSUM}" ] \ - && tar -xzf lua.tar.gz \ - && rm lua.tar.gz - -WORKDIR /lua-${LUA_VERSION} -RUN make -j"$(nproc)" linux \ - && make install - -WORKDIR / -RUN rm -rf lua-${LUA_VERSION} \ - && apk del .build-deps \ - && rm -rf /var/cache/apk/* - -FROM lua AS sumneko-lint +RUN nix-env -iA nixpkgs.lua5_1 nixpkgs.sumneko-lua-language-server COPY lua/entrypoint.lua /entrypoint.lua diff --git a/lua/entrypoint.lua b/lua/entrypoint.lua index af94f59..230827b 100755 --- a/lua/entrypoint.lua +++ b/lua/entrypoint.lua @@ -66,7 +66,6 @@ local function lint(directory) local redirect = ' >' .. stdout_file .. ' 2>' .. stderr_file print(cmd) local exit_code = os.execute(cmd .. redirect) - os.execute('lua-language-server --version > stdout.txt') local stdout = read_file(stderr_file) or '' print(stdout) if exit_code ~= 0 then