-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile.workstation
193 lines (170 loc) · 4.62 KB
/
Dockerfile.workstation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# This is our develop image
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-swedishembedded/build:latest}
ARG EMACS_VERSION=29.3
ARG NEOVIM_VERSION=v0.10.0
ARG NODE_VERSION=22
SHELL ["bash", "-c"]
USER root
RUN mkdir -p /build/platform && \
chown -R user:user /build
RUN apt-get update && \
echo "Installing latest nodejs packages" && \
curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
apt-get -qy install nodejs && \
echo "Installing emacs dependencies" && \
apt-get -qy install --no-install-recommends \
cmake \
ncurses-dev \
libacl1-dev \
libgccjit0 \
libgccjit-14-dev \
libjansson4 \
libjansson-dev \
gnutls-dev \
ripgrep \
wget && \
echo "Installing neovim dependencies" && \
apt-get -qy install --no-install-recommends \
luarocks \
xclip \
biber \
gettext && \
echo "Installing terminal utilities" && \
apt-get -qy install --no-install-recommends \
tree \
tig \
gitk \
picocom \
tmux && \
echo "Installing cypress dependencies" && \
apt-get -qy install --no-install-recommends \
libgtk2.0-0 \
libgtk-3-0 \
libgbm-dev \
libnotify-dev \
libnss3 \
libxss1 \
libasound2-dev \
libxtst6 \
xauth \
xvfb && \
echo "Installing language servers and support tools" && \
apt-get -qy install --no-install-recommends \
clangd \
bash-completion \
yamllint && \
echo "Installing debugging tools" && \
apt-get -qy install --no-install-recommends \
btop \
bc \
gdb-multiarch && \
echo "Installing additional tools" && \
apt-get install --no-install-recommends -y \
openbox \
python3-xdg \
libpython3-dev \
xvfb \
xterm \
iputils-ping \
xz-utils && \
echo "Cleaning up cache.." && \
apt-get clean -y && \
apt-get autoremove --purge -y && \
rm -rf /var/lib/apt/lists/*
# Install ruby packages
RUN gem install \
tmuxinator \
neovim
# Install additional npm packages
RUN npm install -g nmp
RUN npm install -g \
bash-language-server \
neovim \
npm \
pyright \
tailwindcss-language-server \
tree-sitter \
typescript-language-server \
vim-language-server \
yaml-language-server \
yarn \
&& \
npm cache clean --force
# Install additional python packages
RUN pip3 install \
pre-commit \
mypy \
robotframework-lsp \
pynvim && \
echo "Installing renode-run" && \
pip3 install --upgrade git+https://github.com/antmicro/renode-run.git && \
pip3 cache purge
# Build emacs
RUN wget -q https://ftpmirror.gnu.org/emacs/emacs-${EMACS_VERSION}.tar.gz https://ftpmirror.gnu.org/emacs/emacs-${EMACS_VERSION}.tar.gz.sig && \
tar zxf emacs-${EMACS_VERSION}.tar.gz && \
cd emacs-${EMACS_VERSION} && \
./configure \
--with-x-toolkit=no \
--with-xpm=ifavailable \
--with-jpeg=ifavailable \
--with-gif=ifavailable \
--with-tiff=ifavailable \
&& \
make && \
make install && \
cd .. && \
rm -rf emacs-*
USER root
# Install neovim
RUN git clone https://github.com/neovim/neovim.git && \
cd neovim && \
git checkout $NEOVIM_VERSION && \
make CMAKE_BUILD_TYPE=RelWithDebInfo && \
make install && \
cd .. && \
rm -rf neovim
# Add entrypoint script
ADD entrypoint.sh /home/user/init
RUN dos2unix /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
# Install DooM emacs as user
RUN git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs && \
~/.config/emacs/bin/doom env && \
~/.config/emacs/bin/doom install
# Add configuration as user
COPY --chown=user:user conf/doom /home/user/.config/emacs/
RUN ~/.config/emacs/bin/doom env && \
~/.config/emacs/bin/doom upgrade
COPY --chown=user:user conf/.tmux.conf /home/user/.tmux.conf
COPY --chown=user:user conf/.tmux.conf.local /home/user/.tmux.conf.local
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 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 '+TSInstall all' +qa
# Configure environment variables
ENV DISPLAY=:0
ENV CMAKE_PREFIX_PATH=/opt/toolchains
# Configure rust path
ENV RUSTUP_HOME=/opt/rust
ENV CARGO_HOME=/opt/rust
ENV PATH=$PATH:/opt/rust/bin/
# Set working directory
WORKDIR /workspaces/
# Configure default shell and editor
ENV SHELL=/bin/bash
ENV EDITOR=nvim
# Set the init script
ENTRYPOINT ["/home/user/init"]
# Launch bash shell by default
CMD ["/bin/bash"]