소스 검색

fix: Rework Dockerfile to run lvim (#1593)

Subho Banerjee 3 년 전
부모
커밋
6214ff9ef6
2개의 변경된 파일18개의 추가작업 그리고 27개의 파일을 삭제
  1. 18 4
      utils/docker/Dockerfile
  2. 0 23
      utils/docker/script.sh

+ 18 - 4
utils/docker/Dockerfile

@@ -1,11 +1,25 @@
-FROM python:3
+FROM ubuntu:latest
 
-SHELL ["/bin/bash", "-c"]
+ARG NEOVIM_RELEASE=v0.5.0
+ARG LVBRANCH=rolling
 
 ENV DEBIAN_FRONTEND=noninteractive
 
-COPY script.sh /tmp/script.sh
+# Install apt dependencies
+RUN apt update && \
+  apt -y install sudo curl build-essential git fzf python3-dev python3-pip cargo && \
+  curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
+  apt update && \
+  apt -y install nodejs && \
+  curl -L -o /tmp/nvim.appimage https://github.com/neovim/neovim/releases/download/${NEOVIM_RELEASE}/nvim.appimage && \
+  chmod u+x /tmp/nvim.appimage && \
+  /tmp/nvim.appimage --appimage-extract && \
+  mv squashfs-root /usr/local/neovim && \
+  ln -s /usr/local/neovim/usr/bin/nvim /usr/bin/nvim && \
+  apt clean && rm -rf /var/lib/apt/lists/* /tmp/* && \
+  LVBRANCH=${LVBRANCH} curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/rolling/utils/installer/install.sh | bash -s -- -y
 
-RUN bash -c "/tmp/script.sh"
+ENV PATH="/root/.local/bin:/root/.cargo/bin:/root/.npm-global/bin${PATH}"
 
 ENTRYPOINT ["/bin/bash"]
+CMD ["lvim"]

+ 0 - 23
utils/docker/script.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-
-# Updating the package list
-apt-get update
-
-# Installing dependencies
-apt-get -y install tzdata sudo git nodejs npm git ripgrep fzf ranger curl fonts-hack-ttf
-
-pip3 install ueberzug neovim-remote
-npm install tree-sitter-cli neovim
-
-# Installing Neovim
-mkdir -p /tmp/neovim
-cd /tmp/neovim || exit
-curl -L -o nvim.appimage https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
-chmod u+x nvim.appimage
-./nvim.appimage --appimage-extract
-mv squashfs-root /usr/local/neovim
-ln -s /usr/local/neovim/usr/bin/nvim /usr/bin/nvim
-rm ./nvim.appimage
-
-# Installing LunarVim
-LVBRANCH=master bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/rolling/utils/installer/install.sh)