From 36a3ed3bfdf9f099edff600f856364c7541c93c3 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Thu, 6 Jan 2022 14:50:04 -0800 Subject: [PATCH] Cleanup Docker stuff --- .github/workflows/docker.yml | 1 + Makefile | 3 +++ Dockerfile => docker/Dockerfile | 3 ++- docker-entry.sh => docker/docker-entry.sh | 2 +- nvim-container.sh => docker/nvim-container.sh | 11 +++------ update-plugins.sh | 24 ------------------- 6 files changed, 10 insertions(+), 34 deletions(-) rename Dockerfile => docker/Dockerfile (96%) rename docker-entry.sh => docker/docker-entry.sh (97%) rename nvim-container.sh => docker/nvim-container.sh (73%) delete mode 100755 update-plugins.sh diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 22c3e68..89ef38a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,6 +29,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v2 with: + file: ./docker/Dockerfile context: . platforms: linux/amd64 push: true diff --git a/Makefile b/Makefile index 0eb896c..85954bb 100644 --- a/Makefile +++ b/Makefile @@ -50,12 +50,14 @@ check: $(PRE_COMMIT_ENV_BIN)/pre-commit .PHONY: docker-build docker-build: docker build \ + -f ./docker/Dockerfile \ --tag vividboarder/my-neovim . # Build Docker images .PHONY: docker-build-all docker-build-all: docker buildx build \ + -f ./docker/Dockerfile \ --platform linux/arm,linux/arm64,linux/amd64 \ --tag vividboarder/my-neovim . @@ -63,6 +65,7 @@ docker-build-all: .PHONY: docker-build-push docker-build-push: docker buildx build \ + -f ./docker/Dockerfile \ --push \ --platform linux/arm,linux/arm64,linux/amd64 \ --tag vividboarder/my-neovim . diff --git a/Dockerfile b/docker/Dockerfile similarity index 96% rename from Dockerfile rename to docker/Dockerfile index ba2ebf3..1174e12 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -7,6 +7,7 @@ RUN apk add \ curl \ git \ go \ + luarocks \ make \ npm \ py3-pip \ @@ -68,5 +69,5 @@ RUN mkdir -p /home/vividboarder/.data RUN mkdir /home/vividboarder/data WORKDIR /home/vividboarder/data -COPY docker-entry.sh /docker-entry.sh +COPY ./docker/docker-entry.sh /docker-entry.sh ENTRYPOINT /docker-entry.sh diff --git a/docker-entry.sh b/docker/docker-entry.sh similarity index 97% rename from docker-entry.sh rename to docker/docker-entry.sh index 690daf0..78c63c3 100755 --- a/docker-entry.sh +++ b/docker/docker-entry.sh @@ -1,6 +1,6 @@ #! /bin/bash -set -ex +set -e VOLUME_DATA=/home/vividboarder/.data [ -d "$VOLUME_DATA/nvim/backup" ] || mkdir -p "$VOLUME_DATA/nvim/backup" diff --git a/nvim-container.sh b/docker/nvim-container.sh similarity index 73% rename from nvim-container.sh rename to docker/nvim-container.sh index a2de12d..acea0aa 100755 --- a/nvim-container.sh +++ b/docker/nvim-container.sh @@ -1,11 +1,6 @@ #! /bin/bash -set -ex - -if ! docker image ls -q nvim > /dev/null ;then - echo "no nvim image found" - exit 1 -fi +set -e container_name=nvim-$USER @@ -15,11 +10,11 @@ fi docker run --interactive --rm --tty \ --name "$container_name" \ - --env "VIM_COLOR=$VIM_COLOR" \ + --env "NVIM_COLOR=$NVIM_COLOR" \ --volume "${container_name}-home:/home/vividboarder/.data" \ --volume "$(pwd):/home/vividboarder/data" \ --workdir /home/vividboarder/data \ --entrypoint /docker-entry.sh \ --user "vividboarder:$(id -g)" \ --group-add users \ - vividboarder/my-neovim nvim "$@" + vividboarder/my-neovim "$@" diff --git a/update-plugins.sh b/update-plugins.sh deleted file mode 100755 index 2f75b7c..0000000 --- a/update-plugins.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -echo "Update vim-plug" -vim +PlugUpgrade +qall -vim +PlugClean! +qall - -# Install all bundles -echo "Install all bundles" -if hash nvim 2>/dev/null; then - if hash pip 2>/dev/null; then - echo 'Installing neovim python module in $HOME' - pip install --user neovim - fi - echo "If using Neovim, install the python modules in your environment" - nvim +PlugUpdate +PlugInstall +qall -fi -vim +PlugUpdate +PlugInstall +qall - -vim --version | grep -q '\+lua' || { echo "Warning: Default vim does not include lua"; } -vim --version | grep -q '\+ruby' || { echo "Warning: Default vim does not include ruby."; } -vim --version | grep -q '\+python' || { echo "Warning: Default vim does not include python"; } - -echo "All done!" -exit 0