vim-settings/docker/Dockerfile

72 lines
1.7 KiB
Docker
Raw Permalink Normal View History

FROM alpine:3.15
RUN apk add \
bash \
cargo \
ctags \
curl \
git \
go \
2022-01-06 22:50:04 +00:00
luarocks \
make \
npm \
py3-pip \
python3 \
;
2022-01-03 06:23:07 +00:00
# Install neovim from edge repo for latest
RUN apk add neovim --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
2021-12-17 05:05:42 +00:00
# Try to install shellcheck
RUN test "$(uname -m)" = "x86_64" && apk add shellcheck || true
2021-12-17 05:07:49 +00:00
# Try to install rustup
RUN apk add rustup || true
2021-12-17 05:05:42 +00:00
# Install dependencies for python-language-server
RUN apk add gcc g++ python3-dev
# Install neovim python client
RUN pip3 install pynvim
# Create user
RUN adduser -D -h /home/vividboarder -s /bin/bash --ingroup users vividboarder
USER vividboarder
WORKDIR /home/vividboarder
ENV HOME /home/vividboarder
ENV XDG_CONFIG_HOME $HOME/.config
RUN mkdir -p $XDG_CONFIG_HOME
# Configure go path
ENV GOPATH $HOME/go
RUN mkdir -p $GOPATH/bin
ENV PATH $PATH:$GOPATH/bin
# Configure npm path
ENV NPM_PACKAGES $HOME/.npm-packages
RUN npm config set prefix $NPM_PACKAGES
ENV PATH $PATH:$NPM_PACKAGES/bin
ENV PATH $HOME/.local/bin:$PATH
# Install Language servers
COPY --chown=vividboarder:users ./install-language-servers.sh ./
RUN ./install-language-servers.sh
# Add config
COPY --chown=vividboarder:users ./neovim $HOME/.config/nvim
# Sync packer plugins
RUN nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap"
# Bootstrap treesitter parsers
RUN nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quitall
# Create persistent data dir
RUN mkdir -p /home/vividboarder/.data
# Generate workdir
RUN mkdir /home/vividboarder/data
WORKDIR /home/vividboarder/data
2022-01-06 22:50:04 +00:00
COPY ./docker/docker-entry.sh /docker-entry.sh
ENTRYPOINT /docker-entry.sh