17
17
18
18
# Debian Bookworm
19
19
#
20
- # LLVM: https://packages.debian.org/bookworm/llvm 16 .0
20
+ # LLVM: https://packages.debian.org/bookworm/llvm 14 .0
21
21
# GCC: https://packages.debian.org/bookworm/gcc 12.2.0
22
22
23
23
# +-----------------------------+
@@ -43,15 +43,21 @@ FROM debian:bookworm-slim AS downloader
43
43
# Reuse global arguments
44
44
ARG VULKAN_VERSION
45
45
46
- ENV DEBIAN_FRONTEND=noninteractive
47
-
46
+ ENV DEBIAN_FRONTEND=noninteractive \
47
+ CURL_OPTIONS= "--progress-bar --location"
48
48
# ENV CURL_OPTIONS="--silent --show-error --retry 5 --connect-timeout 20 --max-time 10"
49
- ENV CURL_OPTIONS_BAR="--progress-bar"
50
49
51
50
WORKDIR /tmp
52
- RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \
53
- curl $CURL_OPTIONS_BAR -o gcc.xz "http://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz" && \
54
- curl $CURL_OPTIONS_BAR -o vulkansdk.xz "https://sdk.lunarg.com/sdk/download/${VULKAN_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_VERSION}.tar.xz"
51
+ RUN echo "Download Stage" && \
52
+ apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \
53
+ curl $CURL_OPTIONS -o gcc.xz "http://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz" && \
54
+ curl $CURL_OPTIONS -o vulkansdk.xz "https://sdk.lunarg.com/sdk/download/${VULKAN_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_VERSION}.tar.xz" && \
55
+ # Cleanup
56
+ apt-get autoremove -y && \
57
+ apt-get clean autoclean && \
58
+ rm -rf /var/lib/apt/lists/* && \
59
+ # List files in /tmp
60
+ ls -la /tmp
55
61
56
62
# +-----------------------------+
57
63
# | BASE IMAGE | See https://hub.docker.com/_/debian
@@ -98,14 +104,10 @@ LABEL \
98
104
# Y8b d88P
99
105
# "Y88P"
100
106
101
- # +-----------------------------+
102
- # | PRE-REQUISITE/INIT PACKAGES |
103
- # +-----------------------------+
107
+ ENV DEBIAN_FRONTEND=noninteractive \
108
+ CURL_OPTIONS="--progress-bar --location"
104
109
105
- ENV DEBIAN_FRONTEND=noninteractive
106
-
107
- # avoid debconf delaying package configuration, since apt-utils is not installed
108
- RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog 2>&1 && \
110
+ RUN echo "Packages" && \
109
111
apt-get update && apt-get install -y --no-install-recommends \
110
112
gnupg2 ca-certificates software-properties-common \
111
113
build-essential cppcheck valgrind lcov wget git nano jq \
@@ -124,7 +126,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialo
124
126
# optional tools for Doxygen
125
127
python3 python3-pip \
126
128
python3-sphinx python3-sphinx-rtd-theme python3-defusedxml sphinx-common \
127
- graphviz
129
+ graphviz && \
130
+ # Cleanup
131
+ apt-get autoremove -y && \
132
+ apt-get clean autoclean && \
133
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
128
134
129
135
#
130
136
# .d8888b. d8b 888 888 888 .d8888b. 888 8888888
@@ -137,17 +143,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialo
137
143
# "Y8888P88 888 "Y888 888 888 "Y88888 88888P" "Y8888P" 88888888 8888888
138
144
#
139
145
140
- # +-----------------------------+
141
- # | Github CLI |
142
- # +-----------------------------+
143
146
# Website: https://cli.github.com/
144
147
# Installation Instructions: https://github.com/cli/cli/blob/trunk/docs/install_linux.md#official-sources
145
148
146
149
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
147
- RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
150
+ RUN echo "GITHUB CLI" && \
151
+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
148
152
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
149
153
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
150
- apt-get update && apt-get install -y --no-install-recommends gh
154
+ apt-get update && apt-get install -y --no-install-recommends gh && \
155
+ # Cleanup
156
+ apt-get autoremove -y && \
157
+ apt-get clean autoclean && \
158
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
151
159
152
160
#
153
161
# .d8888b. 888b d888 888
@@ -160,15 +168,13 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | d
160
168
# "Y8888P" 888 888 "Y888888 888 888 "Y8888
161
169
#
162
170
163
- # +-----------------------------+
164
- # | CMake - Latest Version |
165
- # +-----------------------------+
166
171
# Latest Release: https://github.com/Kitware/CMake/releases/latest
167
172
168
173
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
169
- RUN version="$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
174
+ RUN echo "CMake" && \
175
+ version="$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
170
176
url="https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-linux-x86_64.sh" ; echo "Download URL: \" $url\" " && \
171
- wget -q $url && \
177
+ curl $CURL_OPTIONS -O $url && \
172
178
mkdir /opt/cmake && \
173
179
sh cmake-$version-linux-x86_64.sh --prefix=/opt/cmake --skip-license && \
174
180
ln -s /opt/cmake/bin/cmake /usr/bin/cmake && \
@@ -185,9 +191,6 @@ RUN version="$(curl -s https://api.github.com/repos/Kitware/CMake/releases/lates
185
191
# Y8P "Y8888P" 888 888 Y88b "Y8888P88
186
192
#
187
193
188
- # +-----------------------------+
189
- # | vcpkg ~225MB|
190
- # +-----------------------------+
191
194
# vcpkg requires curl, unzip, tar, pkg-config (optional cmake).
192
195
# We use the installed binaries from the system.
193
196
# We do not download latest version of CMake and Ninja during vcpkg bootstrap.
@@ -199,7 +202,8 @@ ENV VCPKG_ROOT=/opt/vcpkg \
199
202
ENV PATH="${PATH}:${VCPKG_ROOT}"
200
203
201
204
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
202
- RUN git clone --depth=1 \
205
+ RUN echo "VCPKG" && \
206
+ git clone --depth=1 \
203
207
-c core.eol=lf \
204
208
-c core.autocrlf=false \
205
209
-c fsck.zeroPaddedFilemode=ignore \
@@ -219,12 +223,9 @@ RUN git clone --depth=1 \
219
223
# "Y8888P" "Y8888P" d88P 888 "Y8888P" 888 888 8888888888
220
224
#
221
225
222
- # +-----------------------------+
223
- # | ccache - Latest Version |
224
- # +-----------------------------+
225
-
226
226
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
227
- RUN version="$(curl -s https://api.github.com/repos/ccache/ccache/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
227
+ RUN echo "CCACHE" && \
228
+ version="$(curl -s https://api.github.com/repos/ccache/ccache/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
228
229
url="https://github.com/ccache/ccache/releases/download/v$version/ccache-$version-linux-x86_64.tar.xz" ; echo "Download URL: \" $url\" " && \
229
230
wget -q $url && \
230
231
mkdir -p /opt/ccache/bin &&\
@@ -249,10 +250,11 @@ RUN version="$(curl -s https://api.github.com/repos/ccache/ccache/releases/lates
249
250
# We are using the prebuilt binaries for x64.
250
251
251
252
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
252
- RUN version_string="$(curl -s https://api.github.com/repos/doxygen/doxygen/releases/latest | jq -r '.tag_name')" ; echo "Latest Version: \" $version_string\" " && \
253
+ RUN echo "DOXYGEN" && \
254
+ version_string="$(curl -s https://api.github.com/repos/doxygen/doxygen/releases/latest | jq -r '.tag_name')" ; echo "Latest Version: \" $version_string\" " && \
253
255
version_number="$(echo $version_string | cut -c 9- | sed 's/_/./g')" && \
254
256
url="https://github.com/doxygen/doxygen/releases/download/$version_string/doxygen-$version_number.linux.bin.tar.gz" ; echo "Download URL: \" $url\" " && \
255
- wget -q $url && \
257
+ curl $CURL_OPTIONS -O $url && \
256
258
mkdir /opt/doxygen && \
257
259
tar xf doxygen-$version_number.linux.bin.tar.gz --strip-components=1 -C /opt/doxygen && \
258
260
ln -s /opt/doxygen/bin/doxygen /usr/bin && \
@@ -276,7 +278,8 @@ RUN version_string="$(curl -s https://api.github.com/repos/doxygen/doxygen/relea
276
278
# RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh ${LLVM_VERSION} all && rm ./llvm.sh
277
279
278
280
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
279
- RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
281
+ RUN echo "LLVM" && \
282
+ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
280
283
add-apt-repository -y "deb http://apt.llvm.org/$DEBIAN_VERSION_NAME/ llvm-toolchain-$DEBIAN_VERSION_NAME-$LLVM_VERSION main" && \
281
284
apt-get update && apt-get install -y --no-install-recommends \
282
285
clang-$LLVM_VERSION \
@@ -300,9 +303,10 @@ RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.
300
303
libunwind-$LLVM_VERSION-dev \
301
304
libclang-rt-$LLVM_VERSION-dev \
302
305
libpolly-$LLVM_VERSION-dev && \
303
- apt-get autoremove -y && \
306
+ # Cleanup
307
+ apt-get autoremove -y && \
304
308
apt-get clean autoclean && \
305
- rm -rf /var/lib/apt/lists/*
309
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
306
310
307
311
# add llvm to path
308
312
ENV PATH="/usr/lib/llvm-${LLVM_VERSION}/bin:/usr/lib/llvm-${LLVM_VERSION}/include:${PATH}"
@@ -312,7 +316,8 @@ ENV LD_LIBRARY_PATH="/usr/lib:/usr/local/lib"
312
316
ENV LD_LIBRARY_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib:${LD_LIBRARY_PATH:-}"
313
317
314
318
# unversionize the binaries
315
- RUN ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang && \
319
+ RUN echo "LLVM symlink binaries" && \
320
+ ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang && \
316
321
ln -s /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ && \
317
322
ln -s /usr/bin/clang-format-${LLVM_VERSION} /usr/bin/clang-format
318
323
@@ -321,7 +326,8 @@ ENV CC=/usr/bin/clang \
321
326
CXX=/usr/bin/clang++
322
327
323
328
# update alternatives
324
- RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
329
+ RUN echo "LLVM udate-alternatives" && \
330
+ update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
325
331
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
326
332
327
333
#
@@ -335,15 +341,13 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
335
341
# 888 888 "Y88P" 888 "Y88888
336
342
#
337
343
338
- # +-----------------------------+
339
- # | Mold Linker ~10MB|
340
- # +-----------------------------+
341
344
# We are using Clang++ for compilation, so this download + compile step must happen after installing LLVM+Clang.
342
345
# We don't need to call mold's ./install-build-deps.sh, because all build dependencies are present.
343
346
# Note to overwrite ld: sudo ln -sf /opt/mold/bin/mold $(realpath /usr/bin/ld)
344
347
345
348
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
346
- RUN version="$(curl -s https://api.github.com/repos/rui314/mold/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
349
+ RUN echo "MOLD" && \
350
+ version="$(curl -s https://api.github.com/repos/rui314/mold/releases/latest | jq -r '.tag_name' | cut -c 2-)" ; echo "Latest Version: \" $version\" " && \
347
351
git clone --depth=1 --branch "v$version" https://github.com/rui314/mold.git "/tmp/mold" && \
348
352
cmake -S /tmp/mold -B /tmp/mold/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ && \
349
353
cmake --build /tmp/mold/build -j "$(nproc)" && \
@@ -367,7 +371,8 @@ RUN version="$(curl -s https://api.github.com/repos/rui314/mold/releases/latest
367
371
# +-----------------------------+
368
372
369
373
COPY --from=downloader /tmp/gcc.xz /tmp/gcc.xz
370
- RUN tar xf /tmp/gcc.xz && rm /tmp/gcc.xz && \
374
+ RUN echo "GCC - Extract" && \
375
+ tar xf /tmp/gcc.xz && rm /tmp/gcc.xz && \
371
376
apt-get update && apt-get install -y --no-install-recommends \
372
377
libmpfr-dev libgmp3-dev libmpc-dev
373
378
@@ -383,7 +388,8 @@ WORKDIR /gcc-13.3.0
383
388
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
384
389
385
390
# https://gcc.gnu.org/install/configure.html
386
- RUN ./configure \
391
+ RUN echo "GCC - Compile" && \
392
+ ./configure \
387
393
--libdir=/usr/lib \
388
394
--libexecdir=/usr/lib \
389
395
--prefix=/usr \
@@ -434,8 +440,12 @@ RUN ./configure \
434
440
WORKDIR /
435
441
436
442
# remove gcc source folder and dependencies
437
- RUN rm -rf gcc-13.3.0 && \
438
- apt-get autoremove -y libmpfr-dev libgmp3-dev libmpc-dev
443
+ RUN echo "GCC - Cleanup" && \
444
+ rm -rf gcc-13.3.0 && \
445
+ # Cleanup
446
+ apt-get autoremove -y libmpfr-dev libgmp3-dev libmpc-dev && \
447
+ apt-get clean autoclean && \
448
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
439
449
440
450
# reset default compiler to clang
441
451
ENV CC=/usr/bin/clang \
@@ -462,23 +472,33 @@ ENV TERM=xterm-256color \
462
472
ZSH_THEME=agnoster
463
473
464
474
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
465
- RUN apt-get update && apt-get install -y --no-install-recommends zsh powerline fonts-powerline && \
466
- curl -fsSL https://install.ohmyz.sh | sh && \
475
+ RUN echo "ZSH" && \
476
+ apt-get update && apt-get install -y --no-install-recommends zsh powerline fonts-powerline && \
477
+ # Install Oh My Zsh
478
+ curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh && \
479
+ # Add Zsh plugins
467
480
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
468
481
git clone --depth=1 https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
469
482
git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search && \
483
+ # Update .zshrc
470
484
sed -i "s/plugins=(git)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/" /root/.zshrc && \
471
- sed -i "s/ZSH_THEME=\" agnoster\" /ZSH_THEME=\" robbyrussell\" /" /root/.zshrc
485
+ sed -i "s/ZSH_THEME=\" agnoster\" /ZSH_THEME=\" robbyrussell\" /" /root/.zshrc && \
486
+ # Cleanup
487
+ apt-get autoremove -y && \
488
+ apt-get clean autoclean && \
489
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
472
490
491
+ # Set the default shell to zsh after it is installed
473
492
ENV SHELL=/bin/zsh
474
493
475
494
# +-----------------------------+
476
495
# | CLEANUP |
477
496
# +-----------------------------+
478
497
479
- RUN apt-get autoremove -y && \
498
+ RUN echo "CLeanup" && \
499
+ apt-get autoremove -y && \
480
500
apt-get clean autoclean && \
481
- rm -rf /var/lib/apt/lists/*
501
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
482
502
483
503
# +-----------------------------+
484
504
# | Set Locale + Timezone |
@@ -487,7 +507,8 @@ RUN apt-get autoremove -y && \
487
507
ENV TZ=Europe/Berlin
488
508
489
509
# configure german locale
490
- RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
510
+ RUN echo "Locale & Timezone" && \
511
+ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
491
512
echo $TZ > /etc/timezone && \
492
513
dpkg-reconfigure tzdata && \
493
514
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
@@ -577,8 +598,14 @@ ENV PATH="$VULKAN_SDK/bin:$PATH" \
577
598
# To test CPU rendering using the Mesa Vulkan drivers, you can use "vkcube",
578
599
# which is a simple spinning-cube app to demonstrate Vulkan functionality.
579
600
#
580
- RUN apt-get update && apt-get install -y --no-install-recommends \
581
- mesa-vulkan-drivers
601
+ RUN echo "Mesa" && \
602
+ apt-get update && apt-get install -y --no-install-recommends \
603
+ libgl1-mesa-dri \
604
+ mesa-vulkan-drivers && \
605
+ # Cleanup
606
+ apt-get autoremove -y && \
607
+ apt-get clean autoclean && \
608
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
582
609
583
610
#
584
611
# https://docs.mesa3d.org/envvars.html
0 commit comments