Skip to content

Commit

Permalink
Fix configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Schröder committed Apr 22, 2024
1 parent 56c3410 commit 78e6df1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 50 deletions.
62 changes: 12 additions & 50 deletions Dockerfile.workstation
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ RUN npm install -g \
pyright \
bash-language-server \
yaml-language-server \
yarn \
vim-language-server && \
npm cache clean --force

Expand Down Expand Up @@ -133,11 +134,11 @@ RUN git clone https://github.com/neovim/neovim.git && \
# Add entrypoint script
ADD entrypoint.sh /home/user/init
RUN dos2unix /home/user/init
ENTRYPOINT ["/home/user/init"]

# Adjust directory permissions
RUN mkdir /workspaces/
RUN chown user:user /workspaces/
RUN chown -R user:user /home/user/

# Switch to 'user' context
USER user
Expand All @@ -157,7 +158,6 @@ COPY --chown=user:user conf/tmuxinator /home/user/.config/tmuxinator
COPY --chown=user:user conf/.bashrc /home/user/.bashrc
COPY --chown=user:user conf/pygdbinit /home/user/.pygdbinit
COPY --chown=user:user conf/nvim /home/user/.config/nvim/
RUN chown user:user /home/user/.config

# Install nvim plugin manager, vim plugins and syntax hightlighting for
# important languages.
Expand All @@ -166,58 +166,17 @@ RUN chown user:user /home/user/.config
# failure.
# NOTE: the TSUpdate commands need to be run on separate lines because vim has a
# limit on how many can be chained together.
USER root

RUN chown -R user:user /home/user/.config

USER user

RUN curl -fLo ~/.local/share/nvim/site/autoload/plug.vim \
--create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && \
nvim -e --headless '+PlugInstall --sync' +qa || true && \
nvim -e --headless '+PlugInstall --sync' +qa && \
nvim -e --headless '+TSUpdate angular' +qa && \
nvim -e --headless '+TSUpdate bash' +qa && \
nvim -e --headless '+TSUpdate bibtex' +qa && \
nvim -e --headless '+TSUpdate c' +qa && \
nvim -e --headless '+TSUpdate c_sharp' +qa && \
nvim -e --headless '+TSUpdate cmake' +qa && \
nvim -e --headless '+TSUpdate commonlisp' +qa && \
nvim -e --headless '+TSUpdate cpp' +qa && \
nvim -e --headless '+TSUpdate csv' +qa && \
nvim -e --headless '+TSUpdate devicetree' +qa && \
nvim -e --headless '+TSUpdate diff' +qa && \
nvim -e --headless '+TSUpdate disassembly' +qa && \
nvim -e --headless '+TSUpdate dockerfile' +qa && \
nvim -e --headless '+TSUpdate doxygen' +qa && \
nvim -e --headless '+TSUpdate ebnf' +qa && \
nvim -e --headless '+TSUpdate elixir' +qa && \
nvim -e --headless '+TSUpdate erlang' +qa && \
nvim -e --headless '+TSUpdate git_rebase' +qa && \
nvim -e --headless '+TSUpdate gitcommit' +qa && \
nvim -e --headless '+TSUpdate glsl' +qa && \
nvim -e --headless '+TSUpdate go' +qa && \
nvim -e --headless '+TSUpdate haskell' +qa && \
nvim -e --headless '+TSUpdate hlsl' +qa && \
nvim -e --headless '+TSUpdate html' +qa && \
nvim -e --headless '+TSUpdate json' +qa && \
nvim -e --headless '+TSUpdate kconfig' +qa && \
nvim -e --headless '+TSUpdate latex' +qa && \
nvim -e --headless '+TSUpdate ledger' +qa && \
nvim -e --headless '+TSUpdate linkerscript' +qa && \
nvim -e --headless '+TSUpdate lua' +qa && \
nvim -e --headless '+TSUpdate luadoc' +qa && \
nvim -e --headless '+TSUpdate markdown_inline' +qa && \
nvim -e --headless '+TSUpdate matlab' +qa && \
nvim -e --headless '+TSUpdate prisma' +qa && \
nvim -e --headless '+TSUpdate python' +qa && \
nvim -e --headless '+TSUpdate regex' +qa && \
nvim -e --headless '+TSUpdate robot' +qa && \
nvim -e --headless '+TSUpdate rst' +qa && \
nvim -e --headless '+TSUpdate tsx' +qa && \
nvim -e --headless '+TSUpdate rust' +qa && \
nvim -e --headless '+TSUpdate sql' +qa && \
nvim -e --headless '+TSUpdate ssh_config' +qa && \
nvim -e --headless '+TSUpdate toml' +qa && \
nvim -e --headless '+TSUpdate typescript' +qa && \
nvim -e --headless '+TSUpdate udev' +qa && \
nvim -e --headless '+TSUpdate vim' +qa && \
nvim -e --headless '+TSUpdate vimdoc' +qa && \
nvim -e --headless '+TSUpdate yaml' +qa
nvim -e --headless '+TSInstall all' +qa

# Configure environment variables
ENV DISPLAY=:0
Expand All @@ -235,5 +194,8 @@ WORKDIR /workspaces/
ENV SHELL=/bin/bash
ENV EDITOR=nvim

# Set the init script
ENTRYPOINT ["/home/user/init"]

# Launch bash shell by default
CMD ["/bin/bash"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ image:
./scripts/build workstation

.PHONY: image

define build_image
$(1): Dockerfile.$(1)
docker build \
-f Dockerfile.$(1) \
-t swedishembedded/$(1):latest .
.PHONY: $(1)
endef

$(eval $(call build_image,workstation))

0 comments on commit 78e6df1

Please sign in to comment.