diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8cb205e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +plugin diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 48e4f2a..d5ac5da 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -12,6 +12,8 @@ if [[ "$BRANCH" != "master" ]]; then fi files=( + "Dockerfile" + ".dockerignore" ".githooks" ".gitignore" "init.lua" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee3e2dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:edge + +COPY . /root/.config/nvim + +WORKDIR /project + +RUN apk --no-cache add git neovim bash nodejs npm ripgrep alpine-sdk shfmt black py3-pip && \ + npm install -g pyright bash-language-server dockerfile-language-server-nodejs prettier @fsouza/prettierd && \ + pip install proselint + +ENTRYPOINT ["bash"] diff --git a/README.md b/README.md index 4b3e261..dbec233 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,36 @@ mkdir -p ~/.local/share/nvim && rm -r ~/.local/share/nvim git clone https://github.com/jrodal98/nvim ~/.config/nvim ``` +## Docker + +### Build instructions + +First, build a base image + +``` +docker build . -t ghcr.io/jrodal98/nvim: +``` + +Next, run a container + +``` +docker run -it --rm --name nvim_docker_base ghcr.io/jrodal98/nvim: +``` + +Finally, we must manually complete the build, due to issues with running packer headless. + +1. Run `nvim`, which will trigger the initial packersync (you may see errors - this is okay) +2. Close nvim and then run `nvim` again +3. Wait for all the treesitter and mason LSP configs to download +4. Outside of the container, open another terminal and run this to save the image: `docker container commit --change='ENTRYPOINT ["/usr/bin/nvim"]' nvim_docker_base ghcr.io/jrodal98/nvim:` + +To upload it to ghcr without a github action... + +1. `docker login ghcr.io` +2. enter github username and access token +4. `docker tag ghcr.io/jrodal98/nvim: ghcr.io/jrodal98/nvim:latest` +5. `docker push ghcr.io/jrodal98/nvim:latest` + ## Inspiration - [nvim-basic-ide](https://github.com/LunarVim/nvim-basic-ide)