-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
192 lines (172 loc) · 4.53 KB
/
Dockerfile
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
ARG image
FROM $image
LABEL maintainer="rjbaw"
ENV DEBIAN_FRONTEND=noninteractive
ARG DUSER
ARG DGROUP
ARG DGID
ARG DUID
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ENV DUID=$DUID
ENV DUSER=$DUSER
ENV DGID=$DGID
ENV DGROUP=$DGROUP
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get install -y --no-install-recommends \
devscripts \
software-properties-common \
git \
python3 \
python3-pip \
python3-dev \
python3-tk \
python3-venv \
python3-setuptools \
python3-wheel \
sudo \
unzip \
tmux \
tar \
build-essential \
vim \
apt-transport-https \
gnupg \
apt-utils \
dialog \
wget \
curl \
cmake \
dvipng \
texlive-science \
texlive-latex-extra \
texlive-plain-generic \
texlive-fonts-extra \
texinfo \
texlive-xetex \
texlive-luatex \
latexmk \
imagemagick \
libjansson-dev \
libxpm-dev \
libgif-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libx11-dev \
libncurses5-dev \
libgtk-4-dev \
libwebkit2gtk-4.1-dev \
libtree-sitter-dev \
webkit2gtk-driver \
libvterm-dev \
libgccjit-13-dev \
libmagickcore-dev \
libmagick++-dev \
tk-dev \
libreadline-dev \
gnutls-dev \
dvisvgm \
automake \
autoconf \
clang-format \
libtool \
xclip \
scrot \
xournalpp \
libglibmm-2.4-dev \
libboost-all-dev \
libcppunit-dev \
liblcms2-dev \
libjpeg-dev \
fontconfig \
librsvg2-dev \
libglade2-dev \
nodejs \
npm \
fzf \
bash-completion \
iproute2 \
ispell \
libosmesa6-dev \
libgl1 \
libglfw3 \
patchelf \
bear \
clangd
RUN npm install -g n &&\
n stable
COPY fonts /tmp/fonts/
RUN cp /tmp/fonts/* /usr/local/share/fonts/
RUN sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
RUN cd /tmp && \
curl -L https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.gz -so emacs.tar.gz &&\
tar xf emacs.tar.gz &&\
cd emacs* &&\
./configure \
-C \
--with-cairo \
--with-modules \
--with-x-toolkit=gtk3 \
--with-native-compilation \
--with-imagemagick \
--with-json \
--with-rsvg \
--with-xwidgets \
--with-harfbuzz \
--with-tree-sitter \
CFLAGS='-O3 -march=native' &&\
make -j $(nproc) &&\
make install
RUN userdel `id -nu $DUID` || true
RUN groupadd -g $DGID $DGROUP || true;
RUN useradd -r -m -d /workspace -s /bin/bash -g $DGID -G sudo -u $DUID $DUSER;
RUN passwd -d $DUSER
RUN ulimit -c 0
RUN cd /usr/local/bin &&\
ln -s /usr/bin/python3 python &&\
ln -s /usr/bin/pip3 pip
COPY emacs_config /workspace/.emacs.d
RUN chown -R $DUSER. /workspace
RUN apt-get -y autoremove &&\
apt-get -y autoclean
RUN rm -rf /var/cache/apt
RUN rm -r /tmp/*
USER $DUSER
SHELL ["/bin/bash", "-c"]
RUN curl https://pyenv.run | bash
RUN echo "export JULIA_NUM_THREADS=`nproc`" >> $HOME/.bashrc &&\
echo "export TERM=xterm-256color" >> $HOME/.bashrc &&\
echo "alias em='emacsclient -c -n -a \"\"'" >> $HOME/.bashrc &&\
echo "alias et='emacsclient -t -nw -a \"\"'" >> $HOME/.bashrc &&\
echo "alias jb='jupyter-lab --ip=0.0.0.0'" >> $HOME/.bashrc &&\
echo "source \"/workspace/.cargo/env\"" >> $HOME/.bashrc &&\
echo "export PYENV_ROOT=\"\$HOME/.pyenv\"" >> $HOME/.bashrc &&\
echo "[[ -d \$PYENV_ROOT/bin ]] && export PATH=\"\$PYENV_ROOT/bin:\$PATH\"" >> $HOME/.bashrc &&\
echo "eval \"\$(pyenv init -)\"" >> $HOME/.bashrc &&\
echo "eval \"\$(pyenv virtualenv-init -)\"" >> $HOME/.bashrc &&\
echo "pyenv activate emacs" >> $HOME/.bashrc
COPY requirements.txt /tmp/
RUN export PYENV_ROOT="$HOME/.pyenv" &&\
export PATH="$PYENV_ROOT/bin:$PATH" &&\
eval "$(pyenv init -)" &&\
eval "$(pyenv virtualenv-init -)" &&\
pyenv virtualenv emacs &&\
pyenv activate emacs &&\
pip install -r /tmp/requirements.txt
RUN curl -fsSL https://install.julialang.org | sh -s -- -y && \
. /workspace/.bashrc &&\
. /workspace/.profile &&\
julia -e 'import Pkg; Pkg.add("IJulia")'
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
. /workspace/.cargo/env && \
rustup component add rls
RUN /workspace/.cargo/bin/cargo install texlab
RUN yes | emacs --daemon | cat
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
cd /workspace/.emacs.d/elpa/zmq*/src && \
./configure && \
make -j $(nproc); fi
RUN (cd /workspace/.emacs.d/elpa/zmq* && make -j $(nproc)) || true
WORKDIR /workspace
RUN ["bash"]