Cleanup Docker stuff

This commit is contained in:
ViViDboarder 2022-01-06 14:50:04 -08:00
parent c2f290bb97
commit 36a3ed3bfd
6 changed files with 10 additions and 34 deletions

View File

@ -29,6 +29,7 @@ jobs:
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
file: ./docker/Dockerfile
context: . context: .
platforms: linux/amd64 platforms: linux/amd64
push: true push: true

View File

@ -50,12 +50,14 @@ check: $(PRE_COMMIT_ENV_BIN)/pre-commit
.PHONY: docker-build .PHONY: docker-build
docker-build: docker-build:
docker build \ docker build \
-f ./docker/Dockerfile \
--tag vividboarder/my-neovim . --tag vividboarder/my-neovim .
# Build Docker images # Build Docker images
.PHONY: docker-build-all .PHONY: docker-build-all
docker-build-all: docker-build-all:
docker buildx build \ docker buildx build \
-f ./docker/Dockerfile \
--platform linux/arm,linux/arm64,linux/amd64 \ --platform linux/arm,linux/arm64,linux/amd64 \
--tag vividboarder/my-neovim . --tag vividboarder/my-neovim .
@ -63,6 +65,7 @@ docker-build-all:
.PHONY: docker-build-push .PHONY: docker-build-push
docker-build-push: docker-build-push:
docker buildx build \ docker buildx build \
-f ./docker/Dockerfile \
--push \ --push \
--platform linux/arm,linux/arm64,linux/amd64 \ --platform linux/arm,linux/arm64,linux/amd64 \
--tag vividboarder/my-neovim . --tag vividboarder/my-neovim .

View File

@ -7,6 +7,7 @@ RUN apk add \
curl \ curl \
git \ git \
go \ go \
luarocks \
make \ make \
npm \ npm \
py3-pip \ py3-pip \
@ -68,5 +69,5 @@ RUN mkdir -p /home/vividboarder/.data
RUN mkdir /home/vividboarder/data RUN mkdir /home/vividboarder/data
WORKDIR /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 ENTRYPOINT /docker-entry.sh

View File

@ -1,6 +1,6 @@
#! /bin/bash #! /bin/bash
set -ex set -e
VOLUME_DATA=/home/vividboarder/.data VOLUME_DATA=/home/vividboarder/.data
[ -d "$VOLUME_DATA/nvim/backup" ] || mkdir -p "$VOLUME_DATA/nvim/backup" [ -d "$VOLUME_DATA/nvim/backup" ] || mkdir -p "$VOLUME_DATA/nvim/backup"

View File

@ -1,11 +1,6 @@
#! /bin/bash #! /bin/bash
set -ex set -e
if ! docker image ls -q nvim > /dev/null ;then
echo "no nvim image found"
exit 1
fi
container_name=nvim-$USER container_name=nvim-$USER
@ -15,11 +10,11 @@ fi
docker run --interactive --rm --tty \ docker run --interactive --rm --tty \
--name "$container_name" \ --name "$container_name" \
--env "VIM_COLOR=$VIM_COLOR" \ --env "NVIM_COLOR=$NVIM_COLOR" \
--volume "${container_name}-home:/home/vividboarder/.data" \ --volume "${container_name}-home:/home/vividboarder/.data" \
--volume "$(pwd):/home/vividboarder/data" \ --volume "$(pwd):/home/vividboarder/data" \
--workdir /home/vividboarder/data \ --workdir /home/vividboarder/data \
--entrypoint /docker-entry.sh \ --entrypoint /docker-entry.sh \
--user "vividboarder:$(id -g)" \ --user "vividboarder:$(id -g)" \
--group-add users \ --group-add users \
vividboarder/my-neovim nvim "$@" vividboarder/my-neovim "$@"

View File

@ -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