mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
fix: install treesitter parsers into docker image
Co-authored-by: Dmytro Soltys <soap@slotos.net>
This commit is contained in:
@@ -9,14 +9,24 @@ ARG VIM_VERSION=v9.1.1287
|
||||
ADD --chmod=755 https://github.com/vim/vim-appimage/releases/download/${VIM_VERSION}/Vim-${VIM_VERSION}.glibc2.29-x86_64.AppImage /vim-linux-x86_64.appimage
|
||||
RUN /vim-linux-x86_64.appimage --appimage-extract
|
||||
|
||||
FROM rust:latest AS tree-sitter
|
||||
WORKDIR /work
|
||||
RUN cargo install tree-sitter-cli --root /
|
||||
ADD https://github.com/tree-sitter/tree-sitter-ruby.git /work/tree-sitter-ruby
|
||||
RUN cd tree-sitter-ruby \
|
||||
&& tree-sitter build -o /work/ruby.so
|
||||
ADD https://github.com/tree-sitter/tree-sitter-python.git /work/tree-sitter-python
|
||||
RUN cd tree-sitter-python \
|
||||
&& tree-sitter build -o /work/python.so
|
||||
|
||||
FROM python:latest AS base
|
||||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
||||
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
||||
apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
git \
|
||||
ca-certificates \
|
||||
make
|
||||
git \
|
||||
ca-certificates \
|
||||
make
|
||||
|
||||
FROM base AS test-prep
|
||||
WORKDIR /work
|
||||
@@ -27,6 +37,11 @@ RUN mkdir -p test/vader/vader.vim && git clone --depth=1 https://github.com/june
|
||||
|
||||
FROM python:latest AS nvim
|
||||
|
||||
WORKDIR /work
|
||||
ENV HOME=/work
|
||||
ENV GIT_PAGER=cat
|
||||
ENV TESTS_ENABLE_TREESITTER=1
|
||||
|
||||
# nvim
|
||||
COPY --from=neovim-image /squashfs-root /nvim-root
|
||||
RUN ln -s /nvim-root/AppRun /bin/nvim
|
||||
@@ -35,11 +50,12 @@ RUN ln -s /nvim-root/AppRun /bin/nvim
|
||||
COPY --from=vim-image /squashfs-root /vim-root
|
||||
RUN ln -s /vim-root/AppRun /bin/vim
|
||||
|
||||
WORKDIR /work
|
||||
ENV HOME=/work
|
||||
ENV GIT_PAGER=cat
|
||||
|
||||
COPY . .
|
||||
COPY --from=test-prep /work/test test
|
||||
|
||||
# Treesitter
|
||||
RUN mkdir -p /work/.local/share/nvim/site/parser/
|
||||
COPY --from=tree-sitter /work/ruby.so /work/.local/share/nvim/site/parser/ruby.so
|
||||
COPY --from=tree-sitter /work/python.so /work/.local/share/nvim/site/parser/python.so
|
||||
|
||||
ENTRYPOINT ["bash"]
|
||||
|
||||
Reference in New Issue
Block a user