2021-12-17 04:50:37 +00:00
|
|
|
FROM alpine:3.15
|
2021-06-09 17:23:48 +00:00
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
RUN apk add \
|
2021-06-09 17:23:48 +00:00
|
|
|
bash \
|
2021-12-17 04:50:37 +00:00
|
|
|
cargo \
|
|
|
|
ctags \
|
2021-06-09 17:23:48 +00:00
|
|
|
curl \
|
|
|
|
git \
|
2021-12-17 04:50:37 +00:00
|
|
|
go \
|
2021-06-09 17:23:48 +00:00
|
|
|
make \
|
|
|
|
npm \
|
2021-12-17 04:50:37 +00:00
|
|
|
py3-pip \
|
|
|
|
python3 \
|
|
|
|
;
|
2021-06-09 17:23:48 +00:00
|
|
|
|
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
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Install dependencies for python-language-server
|
|
|
|
RUN apk add gcc g++ python3-dev
|
2021-06-09 17:23:48 +00:00
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Install neovim python client
|
|
|
|
RUN pip3 install pynvim
|
2021-06-09 17:23:48 +00:00
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Create user
|
2022-01-03 06:06:47 +00:00
|
|
|
RUN adduser -D -h /home/vividboarder -s /bin/bash --ingroup users vividboarder
|
2021-06-09 17:23:48 +00:00
|
|
|
USER vividboarder
|
2021-12-17 04:50:37 +00:00
|
|
|
|
2021-06-09 17:23:48 +00:00
|
|
|
WORKDIR /home/vividboarder
|
|
|
|
ENV HOME /home/vividboarder
|
|
|
|
ENV XDG_CONFIG_HOME $HOME/.config
|
|
|
|
RUN mkdir -p $XDG_CONFIG_HOME
|
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Configure go path
|
|
|
|
ENV GOPATH $HOME/go
|
|
|
|
RUN mkdir -p $GOPATH/bin
|
|
|
|
ENV PATH $PATH:$GOPATH/bin
|
2021-06-09 17:23:48 +00:00
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Configure npm path
|
2021-06-09 17:23:48 +00:00
|
|
|
ENV NPM_PACKAGES $HOME/.npm-packages
|
|
|
|
RUN npm config set prefix $NPM_PACKAGES
|
2021-12-17 04:50:37 +00:00
|
|
|
ENV PATH $PATH:$NPM_PACKAGES/bin
|
2021-06-09 17:23:48 +00:00
|
|
|
ENV PATH $HOME/.local/bin:$PATH
|
|
|
|
|
2021-12-17 04:50:37 +00:00
|
|
|
# Install Language servers
|
2022-01-03 06:06:47 +00:00
|
|
|
COPY --chown=vividboarder:users ./install-language-servers.sh ./
|
2021-12-17 04:50:37 +00:00
|
|
|
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
|
2022-01-03 06:06:47 +00:00
|
|
|
COPY --chown=vividboarder:users ./neovim $HOME/.config/nvim
|
2021-12-17 04:50:37 +00:00
|
|
|
|
|
|
|
# Sync packer plugins
|
|
|
|
RUN nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap"
|
2022-01-03 06:06:47 +00:00
|
|
|
# Bootstrap treesitter parsers
|
|
|
|
RUN nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quitall
|
|
|
|
|
|
|
|
# Create persistent data dir
|
|
|
|
RUN mkdir -p /home/vividboarder/.data
|
|
|
|
# VOLUME /home/vividboarder/.data
|
|
|
|
|
|
|
|
# Make home dir read/write for everyone
|
|
|
|
# RUN chown -R ":users" /home/vividboarder
|
|
|
|
# RUN chmod -R a+rw /home/vividboarder
|
|
|
|
# RUN chmod -R a-s /home/vividboarder
|
2021-12-17 04:50:37 +00:00
|
|
|
|
|
|
|
# Generate workdir
|
|
|
|
RUN mkdir /home/vividboarder/data
|
|
|
|
WORKDIR /home/vividboarder/data
|
|
|
|
|
|
|
|
COPY docker-entry.sh /docker-entry.sh
|
|
|
|
ENTRYPOINT /docker-entry.sh
|