Browse Source

Cleanup Docker stuff

master
ViViDboarder 6 months ago
parent
commit
36a3ed3bfd
  1. 1
      .github/workflows/docker.yml
  2. 3
      Makefile
  3. 3
      docker/Dockerfile
  4. 2
      docker/docker-entry.sh
  5. 11
      docker/nvim-container.sh
  6. 24
      update-plugins.sh

1
.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

3
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 .

3
Dockerfile → 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

2
docker-entry.sh → 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"

11
nvim-container.sh → 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 "$@"

24
update-plugins.sh

@ -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
Loading…
Cancel
Save