mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 13:27:38 +00:00
Update Dockerfile and related Docker scripts
Now working nvim in Docker!
This commit is contained in:
parent
d004dbee79
commit
ed73884345
@ -2,6 +2,11 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.pre_commit_env/
|
.pre_commit_env/
|
||||||
tags
|
tags
|
||||||
|
neovim/backup/
|
||||||
|
neovim/plugged/
|
||||||
|
neovim/plugin/packer_compiled.lua
|
||||||
|
neovim/spell/
|
||||||
|
neovim/tmp/
|
||||||
vim/.netrwhist
|
vim/.netrwhist
|
||||||
vim/UltiSnips
|
vim/UltiSnips
|
||||||
vim/autoload/plug.vim
|
vim/autoload/plug.vim
|
||||||
@ -14,5 +19,3 @@ vim/spell/
|
|||||||
vim/tmp/
|
vim/tmp/
|
||||||
vim/tmp/viminfo.*
|
vim/tmp/viminfo.*
|
||||||
vim/view/
|
vim/view/
|
||||||
Dockerfile
|
|
||||||
Makefile
|
|
||||||
|
105
Dockerfile
105
Dockerfile
@ -1,81 +1,68 @@
|
|||||||
FROM ubuntu:hirsute
|
FROM alpine:3.15
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
RUN apk add \
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
bash \
|
bash \
|
||||||
|
cargo \
|
||||||
|
ctags \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
golang \
|
go \
|
||||||
gopls \
|
|
||||||
make \
|
make \
|
||||||
neovim \
|
neovim \
|
||||||
npm \
|
npm \
|
||||||
python3-autopep8 \
|
py3-pip \
|
||||||
python3-flake8 \
|
python3 \
|
||||||
python3-mypy \
|
rustup \
|
||||||
python3-neovim \
|
shellcheck \
|
||||||
python3-pip \
|
;
|
||||||
python3-proselint \
|
|
||||||
python3-pyls-black \
|
|
||||||
python3-venv \
|
|
||||||
universal-ctags \
|
|
||||||
yamllint \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN useradd -ms /bin/bash vividboarder
|
# Install dependencies for python-language-server
|
||||||
|
RUN apk add gcc g++ python3-dev
|
||||||
|
|
||||||
RUN mkdir -p /go/bin
|
# Install neovim python client
|
||||||
ENV PATH $PATH:/go/bin
|
RUN pip3 install pynvim
|
||||||
RUN GOPATH=/go go get -u github.com/davidrjenni/reftools/cmd/fillstruct@master \
|
|
||||||
&& GOPATH=/go go get -u github.com/fatih/gomodifytags@latest \
|
|
||||||
&& GOPATH=/go go get -u github.com/fatih/motion@latest \
|
|
||||||
# && GOPATH=/go go get -u github.com/go-delve/delve/cmd/dlv@latest \
|
|
||||||
&& GOPATH=/go go get -u github.com/josharian/impl@master \
|
|
||||||
&& GOPATH=/go go get -u github.com/jstemmer/gotags@master \
|
|
||||||
&& GOPATH=/go go get -u github.com/kisielk/errcheck@latest \
|
|
||||||
&& GOPATH=/go go get -u github.com/klauspost/asmfmt/cmd/asmfmt@latest \
|
|
||||||
&& GOPATH=/go go get -u github.com/koron/iferr@master \
|
|
||||||
&& GOPATH=/go go get -u github.com/rogpeppe/godef@latest \
|
|
||||||
&& GOPATH=/go go get -u golang.org/x/lint/golint@master \
|
|
||||||
&& GOPATH=/go go get -u golang.org/x/tools/cmd/goimports@master \
|
|
||||||
&& GOPATH=/go go get -u golang.org/x/tools/cmd/gorename@master \
|
|
||||||
&& GOPATH=/go go get -u golang.org/x/tools/cmd/guru@master \
|
|
||||||
&& GOPATH=/go go get -u honnef.co/go/tools/cmd/keyify@master \
|
|
||||||
&& GOPATH=/go go get -u honnef.co/go/tools/cmd/staticcheck@latest \
|
|
||||||
&& GOPATH=/go go get -u github.com/mrtazz/checkmake \
|
|
||||||
&& rm -fr /go/src /go/pkg
|
|
||||||
|
|
||||||
RUN pip install --no-cache-dir \
|
|
||||||
reorder-python-imports \
|
|
||||||
vim-vint
|
|
||||||
|
|
||||||
RUN npm install -g \
|
|
||||||
alex \
|
|
||||||
bash-language-server \
|
|
||||||
csslint \
|
|
||||||
pyright
|
|
||||||
|
|
||||||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v1.35.2
|
|
||||||
# RUN GOPATH=/go go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
||||||
|
|
||||||
|
# Create user
|
||||||
|
RUN adduser -D -h /home/vividboarder -s /bin/bash vividboarder
|
||||||
USER vividboarder
|
USER vividboarder
|
||||||
VOLUME /home/vividboarder
|
|
||||||
WORKDIR /home/vividboarder
|
WORKDIR /home/vividboarder
|
||||||
ENV HOME /home/vividboarder
|
ENV HOME /home/vividboarder
|
||||||
ENV XDG_CONFIG_HOME $HOME/.config
|
ENV XDG_CONFIG_HOME $HOME/.config
|
||||||
RUN mkdir -p $XDG_CONFIG_HOME
|
RUN mkdir -p $XDG_CONFIG_HOME
|
||||||
|
|
||||||
COPY --chown=vividboarder:vividboarder . /vim-settings
|
# Create persistent data dir
|
||||||
|
RUN mkdir -p /home/vividboarder/.data
|
||||||
|
VOLUME /home/vividboarder/.data
|
||||||
|
|
||||||
# RUN ln -s $HOME/settings/vim "$XDG_CONFIG_HOME/nvim"
|
# Configure go path
|
||||||
# RUN ln -s $HOME/settings/vim "$HOME/.vim"
|
ENV GOPATH $HOME/go
|
||||||
# RUN ln -s $HOME/settings/vim/init.vim "$HOME/.vimrc"
|
RUN mkdir -p $GOPATH/bin
|
||||||
|
ENV PATH $PATH:$GOPATH/bin
|
||||||
|
|
||||||
|
# Configure npm path
|
||||||
ENV NPM_PACKAGES $HOME/.npm-packages
|
ENV NPM_PACKAGES $HOME/.npm-packages
|
||||||
# RUN mkdir $NPM_PACKAGES
|
|
||||||
RUN npm config set prefix $NPM_PACKAGES
|
RUN npm config set prefix $NPM_PACKAGES
|
||||||
ENV PATH $PATH:$NPM_PACKAGES
|
ENV PATH $PATH:$NPM_PACKAGES/bin
|
||||||
ENV PATH $HOME/.local/bin:$PATH
|
ENV PATH $HOME/.local/bin:$PATH
|
||||||
# RUN ./settings/install-language-servers.sh
|
|
||||||
|
|
||||||
RUN mkdir data
|
# Install Language servers
|
||||||
|
COPY --chown=vividboarder:vividboarder ./install-language-servers.sh ./
|
||||||
|
RUN ./install-language-servers.sh
|
||||||
|
# Install golangci-lint
|
||||||
|
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.43.0
|
||||||
|
|
||||||
|
# Add config
|
||||||
|
COPY --chown=vividboarder:vividboarder ./neovim $HOME/.config/nvim
|
||||||
|
|
||||||
|
# Sync packer plugins
|
||||||
|
RUN nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap"
|
||||||
|
# This may not actually do anyting. Haven't figured out how to get compiled ts files into the image
|
||||||
|
RUN nvim --headless -c "TSUpdateSync" -c "quitall"
|
||||||
|
|
||||||
|
# Generate workdir
|
||||||
|
RUN mkdir /home/vividboarder/data
|
||||||
|
WORKDIR /home/vividboarder/data
|
||||||
|
|
||||||
|
COPY docker-entry.sh /docker-entry.sh
|
||||||
|
ENTRYPOINT /docker-entry.sh
|
||||||
|
@ -1,16 +1,28 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
VIM_SYNC_DIR=$HOME/vim-settings
|
# VIM_SYNC_DIR=$HOME/vim-settings
|
||||||
# copy settings to volume
|
# # copy settings to volume
|
||||||
[ -d "$VIM_SYNC_DIR" ] || cp -r /vim-settings "$VIM_SYNC_DIR"
|
# [ -d "$VIM_SYNC_DIR" ] || cp -r /vim-settings "$VIM_SYNC_DIR"
|
||||||
|
#
|
||||||
|
# # Link config files
|
||||||
|
# [ -d "$XDG_CONFIG_HOME" ] || mkdir -p "$XDG_CONFIG_HOME"
|
||||||
|
# [ -d "$XDG_CONFIG_HOME/nvim" ] || ln -s "$VIM_SYNC_DIR/vim" "$XDG_CONFIG_HOME/nvim"
|
||||||
|
# [ -d "$XDG_CONFIG_HOME/nvim/backup" ] || mkdir -p "$XDG_CONFIG_HOME/nvim/backup"
|
||||||
|
# [ -d "$HOME/.vim" ] || ln -s "$VIM_SYNC_DIR/vim" "$HOME/.vim"
|
||||||
|
# [ -f "$HOME/.vimrc" ] || ln -s "$VIM_SYNC_DIR/vim/init.vim" "$HOME/.vimrc"
|
||||||
|
|
||||||
# Link config files
|
VOLUME_DATA=/home/vividboarder/.data
|
||||||
[ -d "$XDG_CONFIG_HOME" ] || mkdir -p "$XDG_CONFIG_HOME"
|
[ -d "$VOLUME_DATA/nvim/backup" ] || mkdir -p "$VOLUME_DATA/nvim/backup"
|
||||||
[ -d "$XDG_CONFIG_HOME/nvim" ] || ln -s "$VIM_SYNC_DIR/vim" "$XDG_CONFIG_HOME/nvim"
|
[ -d "$XDG_CONFIG_HOME/nvim/backup" ] || ln -s "$VOLUME_DATA/nvim/backup" "$XDG_CONFIG_HOME/nvim/backup"
|
||||||
[ -d "$XDG_CONFIG_HOME/nvim/backup" ] || mkdir -p "$XDG_CONFIG_HOME/nvim/backup"
|
|
||||||
[ -d "$HOME/.vim" ] || ln -s "$VIM_SYNC_DIR/vim" "$HOME/.vim"
|
|
||||||
[ -f "$HOME/.vimrc" ] || ln -s "$VIM_SYNC_DIR/vim/init.vim" "$HOME/.vimrc"
|
|
||||||
|
|
||||||
exec "$@"
|
TS_PARSERS="share/nvim/site/pack/packer/start/nvim-treesitter/parser"
|
||||||
|
[ -d "$VOLUME_DATA/ts-parsers" ] || mkdir -p "$VOLUME_DATA/ts-parsers"
|
||||||
|
rm -fr "$HOME/.local/$TS_PARSERS" || ln -s "$VOLUME_DATA/ts-parsers" "$HOME/.local/$TS_PARSERS"
|
||||||
|
|
||||||
|
if [ "$1" == "bash" ]; then
|
||||||
|
exec "$@"
|
||||||
|
else
|
||||||
|
exec nvim "$@"
|
||||||
|
fi
|
||||||
|
@ -14,9 +14,10 @@ fi
|
|||||||
docker run --interactive --rm --tty \
|
docker run --interactive --rm --tty \
|
||||||
--name "$container_name" \
|
--name "$container_name" \
|
||||||
--env "VIM_COLOR=$VIM_COLOR" \
|
--env "VIM_COLOR=$VIM_COLOR" \
|
||||||
--volume "${container_name}-home:/home/vividboarder" \
|
--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 /vim-settings/docker-entry.sh \
|
--entrypoint /docker-entry.sh \
|
||||||
vividboarder/my-neovim nvim "$@"
|
--user "$(id -u):$(id -g)" \
|
||||||
# --user "$(id -u):$(id -g)" \
|
nvim "$@"
|
||||||
|
# vividboarder/my-neovim nvim "$@"
|
||||||
|
@ -29,7 +29,9 @@ if hash nvim 2>/dev/null; then
|
|||||||
echo "If using Neovim, install the python modules in your environment"
|
echo "If using Neovim, install the python modules in your environment"
|
||||||
nvim +PlugInstall +qall
|
nvim +PlugInstall +qall
|
||||||
fi
|
fi
|
||||||
vim +PlugInstall +qall
|
if hash vim 2>/dev/null; then
|
||||||
|
vim +PlugInstall +qall
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "All done!"
|
echo "All done!"
|
||||||
|
Loading…
Reference in New Issue
Block a user