2021-06-09 17:23:48 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
2022-01-03 06:06:47 +00:00
|
|
|
set -ex
|
|
|
|
|
2021-06-09 17:23:48 +00:00
|
|
|
if ! docker image ls -q nvim > /dev/null ;then
|
|
|
|
echo "no nvim image found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
container_name=nvim-$USER
|
|
|
|
|
|
|
|
if ! docker inspect "${container_name}-home" > /dev/null ; then
|
|
|
|
docker volume create "${container_name}-home"
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker run --interactive --rm --tty \
|
|
|
|
--name "$container_name" \
|
|
|
|
--env "VIM_COLOR=$VIM_COLOR" \
|
2021-12-17 04:50:37 +00:00
|
|
|
--volume "${container_name}-home:/home/vividboarder/.data" \
|
2021-06-09 17:23:48 +00:00
|
|
|
--volume "$(pwd):/home/vividboarder/data" \
|
|
|
|
--workdir /home/vividboarder/data \
|
2021-12-17 04:50:37 +00:00
|
|
|
--entrypoint /docker-entry.sh \
|
2022-01-03 06:06:47 +00:00
|
|
|
--user "vividboarder:$(id -g)" \
|
|
|
|
--group-add users \
|
2022-01-03 06:24:13 +00:00
|
|
|
vividboarder/my-neovim nvim "$@"
|