15
15
#
16
16
#
17
17
18
+ # +-----------------------------+
19
+ # | GLOBAL ARGS |
20
+ # +-----------------------------+
21
+ # To use them, redeclare without value inside each FROM.
22
+ # For example, VULKAN_VERSION is used in the FROM sections of "downloader" and "cpp-devbox-with-vulkansdk".
23
+ ARG DEBIAN_VERSION=12
24
+ ARG DEBIAN_VERSION_NAME=bookworm
25
+ ARG GCC_VERSION=13
26
+ ARG LLVM_VERSION=17
27
+ ARG VULKAN_VERSION=1.3.275.0
28
+
18
29
# +-----------------------------+
19
30
# | Downloader |
20
31
# +-----------------------------+
24
35
25
36
FROM debian:bookworm-slim as downloader
26
37
27
- ARG VULKAN_VERSION=1.3.261.1
38
+ # reusing global arg
39
+ ARG VULKAN_VERSION
28
40
29
41
# ENV CURL_OPTIONS "--silent --show-error --retry 5 --connect-timeout 20 --max-time 10"
30
42
ENV CURL_OPTIONS_BAR "--progress-bar"
@@ -42,13 +54,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
42
54
FROM debian:bookworm-slim as cpp-devbox-base
43
55
44
56
# +-----------------------------+
45
- # | ARGS |
57
+ # | REUSE GLOBAL ARGS |
46
58
# +-----------------------------+
47
59
48
- ARG DEBIAN_VERSION=12
49
- ARG DEBIAN_VERSION_NAME=bookworm
50
- ARG GCC_VERSION=13
51
- ARG LLVM_VERSION=17
60
+ ARG DEBIAN_VERSION
61
+ ARG DEBIAN_VERSION_NAME
62
+ ARG GCC_VERSION
63
+ ARG LLVM_VERSION
52
64
53
65
# +-----------------------------+
54
66
# | METADATA |
@@ -182,11 +194,11 @@ RUN version="$(curl -s https://api.github.com/repos/Kitware/CMake/releases/lates
182
194
# - We use the installed binaries from the system.
183
195
# - We do not download latest version of CMake and Ninja during vcpkg bootstrap.
184
196
185
- ENV VCPKG_ROOT=/opt/vcpkg
197
+ ENV VCPKG_ROOT=/opt/vcpkg \
198
+ VCPKG_TRIPLET=x64-linux \
199
+ VCPKG_FORCE_SYSTEM_BINARIES=1 \
200
+ VCPKG_USE_SYSTEM_BINARIES=1
186
201
ENV PATH="${PATH}:${VCPKG_ROOT}"
187
- ENV VCPKG_TRIPLET=x64-linux
188
- ENV VCPKG_FORCE_SYSTEM_BINARIES=1
189
- ENV VCPKG_USE_SYSTEM_BINARIES=1
190
202
191
203
RUN git clone --depth=1 \
192
204
-c core.eol=lf \
@@ -253,8 +265,8 @@ RUN ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang && \
253
265
ln -s /usr/bin/clang-format-${LLVM_VERSION} /usr/bin/clang-format
254
266
255
267
# update compiler environment vars
256
- ENV CC=/usr/bin/clang
257
- ENV CXX=/usr/bin/clang++
268
+ ENV CC=/usr/bin/clang \
269
+ CXX=/usr/bin/clang++
258
270
259
271
# update alternatives
260
272
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
@@ -281,8 +293,8 @@ RUN tar xf /tmp/gcc.xz && rm /tmp/gcc.xz && \
281
293
libmpfr-dev libgmp3-dev libmpc-dev
282
294
283
295
# set default compiler to gcc
284
- ENV CC=/usr/bin/gcc
285
- ENV CXX=/usr/bin/g++
296
+ ENV CC=/usr/bin/gcc \
297
+ CXX=/usr/bin/g++
286
298
287
299
# installing into /usr instead of /usr/local to have consistent paths in CMakePresets:
288
300
# /usr/bin/g++-12
@@ -354,8 +366,8 @@ RUN ./configure \
354
366
# apt-get autoremove -y libmpfr-dev libgmp3-dev libmpc-dev
355
367
356
368
# reset default compiler to clang
357
- ENV CC=/usr/bin/clang
358
- ENV CXX=/usr/bin/clang++
369
+ ENV CC=/usr/bin/clang \
370
+ CXX=/usr/bin/clang++
359
371
360
372
#
361
373
# 8888888888P .d8888b. 888 888
@@ -374,8 +386,8 @@ ENV CXX=/usr/bin/clang++
374
386
# setup zsh, omyzsh, powerline fonts
375
387
# setup zsh plugins: autosuggestions, autocompletions, history search
376
388
377
- ENV TERM=xterm-256color
378
- ENV ZSH_THEME agnoster
389
+ ENV TERM=xterm-256color \
390
+ ZSH_THEME= agnoster
379
391
380
392
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
381
393
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -429,7 +441,8 @@ ENV DEBIAN_FRONTEND=dialog
429
441
430
442
FROM cpp-devbox-base as cpp-devbox-with-vulkansdk
431
443
432
- ENV VULKAN_VERSION=1.3.261.1
444
+ # reusing global arg
445
+ ARG VULKAN_VERSION
433
446
434
447
# +-----------------------------+
435
448
# | METADATA |
0 commit comments