-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
2305 lines (1953 loc) · 77.9 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# syntax=docker/dockerfile:1
#
# TiaC Systems Network - Ubuntu Read-our-Docs Workspace
#
# -- derived from TSN TeX Live Workspace Docker image
# -- see: https://github.com/tiacsys/tsn-ubtl-ws/pkgs/container/tsn-ubtl-ws
# -- see: https://github.com/tiacsys/tsn-ubtl-ws
#
# -- derived from Read the Docs Docker images
# -- see: https://github.com/readthedocs/readthedocs-docker-images
# -- see: https://github.com/readthedocs/readthedocs-docker-images/blob/main/Dockerfile
#
# -- support Docker multi-platform image build
# -- see: https://docs.docker.com/build/building/multi-platform
# -- see: https://docs.docker.com/build/building/variables/#multi-platform-build-arguments
#
# -- TARGETPLATFORM=linux/amd64: TARGETOS=linux, TARGETARCH=amd64, TARGETVARIANT=
# -- TARGETPLATFORM=linux/arm/v7: TARGETOS=linux, TARGETARCH=arm, TARGETVARIANT=v7
# -- TARGETPLATFORM=linux/arm64/v8: TARGETOS=linux, TARGETARCH=arm64, TARGETVARIANT=v8
# -- TARGETPLATFORM=linux/riscv64: TARGETOS=linux, TARGETARCH=riscv64, TARGETVARIANT=
# -- TARGETPLATFORM=linux/ppc64le: TARGETOS=linux, TARGETARCH=ppc64le, TARGETVARIANT=
# -- TARGETPLATFORM=linux/s390x: TARGETOS=linux, TARGETARCH=s390x, TARGETVARIANT=
#
# -- https://patorjk.com/software/taag/#p=display&c=bash&f=Tmplr&t=ALL
# -- https://patorjk.com/software/taag/#p=display&c=bash&f=Tmplr&t=FINAL
# -- https://patorjk.com/software/taag/#p=display&c=bash&f=Tmplr&t=SYS
# -- https://patorjk.com/software/taag/#p=display&c=bash&f=Big%20Chief&t=Section
#
# -- about 40 minutes
# ___________________________
# ____
# / )
# ---/__ /-----__---__----__-
# / ) / ) (_ ` /___)
# _/____/___(___(_(__)_(___ _
#
#
# ############################################################################
# ┏┓┓┏┏┓
# System maintenance with TSN TeX Live Workspace Docker image ┗┓┗┫┗┓
# ┗┛┗┛┗┛
# ############################################################################
FROM ghcr.io/tiacsys/tsn-ubtl-ws:2024.10.0 AS base
# overwrite Ubuntu default metadata
LABEL mantainer="Stephan Linz <[email protected]>"
LABEL version="2024.10.0"
# ############################################################################
# workspace user definitions (copied from tiacsys/tsn-asdf-ws Dockerfile)
ARG WSUSER_HOME=/home/tsn
ARG WSUSER_NAME=tsn
# ############################################################################
# switch to superuser
USER root
WORKDIR /
# ############################################################################
# Install requirements
RUN apt-get --assume-yes update \
&& apt-get --assume-yes dist-upgrade \
&& apt-get --assume-yes install --no-install-recommends \
aspell \
aspell-de \
aspell-de-1901 \
aspell-en \
autoconf \
bash \
build-essential \
bzr \
clang \
coreutils \
curl \
default-jre \
dirmngr \
doxygen \
enchant-2 \
gfortran \
git-core \
gpg \
graphviz \
hunspell \
hunspell-de-at \
hunspell-de-ch \
hunspell-de-de \
hunspell-de-med \
hunspell-en-au \
hunspell-en-ca \
hunspell-en-gb \
hunspell-en-med \
hunspell-en-us \
hunspell-en-za \
imagemagick \
ispell \
iamerican-huge \
ibritish-huge \
ingerman \
libarchive-dev \
libaspell-dev \
libasound2-dev \
libbz2-dev \
libcairo2-dev \
libcppdap-dev \
libcurl4-openssl-dev \
libdb-dev \
libenchant-2-dev \
libevent-dev \
libexpat1-dev \
libffi-dev \
libfreetype-dev \
libgbm-dev \
libgdbm-dev \
libgmp-dev \
libgraphviz-dev \
libgtest-dev \
libhunspell-dev \
libidn-dev \
libjpeg8-dev \
libjpeg-dev \
libjsoncpp-dev \
liblapack-dev \
liblcms2-dev \
liblzma-dev \
libmysqlclient-dev \
libncurses-dev \
libnuspell-dev \
libopenblas-dev \
libpq-dev \
libpspell-dev \
libreadline-dev \
librhash-dev \
librsvg2-bin \
librsvg2-dev \
librtmp-dev \
libsqlite3-dev \
libssh2-1-dev \
libssl-dev \
libtiff5-dev \
libuv1-dev \
libwebp-dev \
libxml2-dev \
libxmlsec1-dev \
libxslt1-dev \
libxslt-dev \
libyaml-dev \
llvm \
mercurial \
myspell-de-de-1901 \
nettle-dev \
nuspell \
pandoc \
pandoc-sidenote \
pandoc-plantuml-filter \
patch \
pdf2svg \
pkg-config \
plantuml \
poppler-utils \
postgresql-client \
python3 \
python3-clang \
python3-dev \
python3-pip \
python3-venv \
re2c \
spell \
subversion \
swig \
tar \
tk-dev \
unzip \
uuid-dev \
wamerican-huge \
wbritish-huge \
wcanadian-huge \
wgerman-medical \
wget \
wngerman \
xz-utils \
zlib1g-dev \
&& apt-get --assume-yes autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# ############################################################################
# switch to workspace user
USER $WSUSER_NAME
WORKDIR $WSUSER_HOME
# ############################################################################
# ┏┓┏┓┳┓┏┓
# System maintenance for multiple runtime version management ┣┫┗┓┃┃┣
# ┛┗┗┛┻┛┻
# ############################################################################
#
# Manage multiple runtime versions with the
# ASDF version manager in workspace user space.
# https://github.com/asdf-vm/asdf
#
# Create on demand patches (hot-fixes)
COPY <<-"EO-ASDF-VM-PATCH" asdf-vm.patch
diff -purN .asdf-orig/plugins/cmake/lib/utils.bash .asdf/plugins/cmake/lib/utils.bash
--- .asdf-orig/plugins/cmake/lib/utils.bash
+++ .asdf/plugins/cmake/lib/utils.bash
@@ -53,10 +53,10 @@ get_source_download_url() {
if [[ "$version" =~ ^[0-9]+\.* ]]; then
# if version is a release number, prepend v
- echo "https://github.com/Kitware/CMake/archive/v${version}.zip"
+ echo "https://github.com/Kitware/CMake/archive/v${version}.tar.gz"
else
# otherwise it can be a branch name or commit sha
- echo "https://github.com/Kitware/CMake/archive/${version}.zip"
+ echo "https://github.com/Kitware/CMake/archive/${version}.tar.gz"
fi
}
@@ -107,7 +107,7 @@ binary_download_and_extract() {
local download_dir=$2
local extract_dir="${download_dir}/bin"
- mkdir -p "$extract_dir"
+ mkdir -p "${extract_dir}"
local download_file="${download_dir}/${TOOL_NAME}-${version}-bin.tar.gz"
@@ -117,6 +117,7 @@ binary_download_and_extract() {
return 0
fi
+ rm -rf "${extract_dir}"
return 1
}
@@ -127,7 +128,7 @@ source_download_and_extract() {
local download_dir=$2
local extract_dir="${download_dir}/src"
- mkdir -p "$extract_dir"
+ mkdir -p "${extract_dir}"
local download_file="${download_dir}/${TOOL_NAME}-${version}-src.tar.gz"
@@ -137,6 +138,7 @@ source_download_and_extract() {
return 0
fi
+ rm -rf "${extract_dir}"
return 1
}
diff -purN .asdf-orig/plugins/ninja/bin/install .asdf/plugins/ninja/bin/install
--- .asdf-orig/plugins/ninja/bin/install
+++ .asdf/plugins/ninja/bin/install
@@ -31,7 +31,8 @@ install_ninja() {
fail "asdf-ninja supports release installs only"
fi
- local platform
+ local platform=""
+ local arch=""
case "$OSTYPE" in
darwin*) platform="mac" ;;
@@ -39,7 +40,13 @@ install_ninja() {
*) fail "Unsupported platform" ;;
esac
- local download_url="https://github.com/ninja-build/ninja/releases/download/v${version}/ninja-${platform}.zip"
+ case "$(uname -m)" in
+ x86_64 | amd64) arch="" ;;
+ aarch64 | arm64) arch="aarch64" ;;
+ *) fail "Unsupported architecture" ;;
+ esac
+
+ local download_url="https://github.com/ninja-build/ninja/releases/download/v${version}/ninja-${platform}${arch:+-$arch}.zip"
local source_path="${install_path}/bin/ninja.zip"
(
diff -purN .asdf-orig/plugins/python/bin/install .asdf/plugins/python/bin/install
--- .asdf-orig/plugins/python/bin/install
+++ .asdf/plugins/python/bin/install
@@ -19,14 +19,14 @@ install_python() {
if [[ -n "${ASDF_PYTHON_PATCH_URL:-}" ]]; then
echo "python-build --patch $version $install_path"
echo "with patch file from: $ASDF_PYTHON_PATCH_URL"
- $(python_build_path) --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL")
+ $(python_build_path) ${PYTHON_BUILD_OPTS} --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL")
elif [[ -n "${ASDF_PYTHON_PATCHES_DIRECTORY:-}" ]] && [[ -f ${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch ]]; then
local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch
echo "python-build $version $install_path -p < $patch_file"
- $(python_build_path) "$version" "$install_path" -p < $patch_file
+ $(python_build_path) ${PYTHON_BUILD_OPTS} "$version" "$install_path" -p < $patch_file
else
echo "python-build $version $install_path"
- $(python_build_path) "$version" "$install_path"
+ $(python_build_path) ${PYTHON_BUILD_OPTS} "$version" "$install_path"
fi
}
EO-ASDF-VM-PATCH
# Install ASDF required plugins and patch on demand locally
# - https://github.com/asdf-community/asdf-python?tab=readme-ov-file#default-python-packages
# - https://github.com/asdf-community/asdf-golang?tab=readme-ov-file#default-go-get-packages
# - https://github.com/asdf-community/asdf-golang?tab=readme-ov-file#goroot
# - https://github.com/asdf-vm/asdf-nodejs?tab=readme-ov-file#default-npm-packages
# - https://github.com/asdf-vm/asdf-ruby?tab=readme-ov-file#default-gems
# - https://github.com/code-lever/asdf-rust?tab=readme-ov-file#default-cargo-crates
RUN asdf plugin update --all \
&& asdf plugin add \
cmake \
https://github.com/asdf-community/asdf-cmake.git \
\
&& asdf plugin add \
ninja \
https://github.com/asdf-community/asdf-ninja.git \
\
&& asdf plugin add \
python \
https://github.com/asdf-community/asdf-python.git \
&& touch $WSUSER_HOME/.default-python-packages \
\
&& asdf plugin add \
golang \
https://github.com/asdf-community/asdf-golang.git \
&& touch $WSUSER_HOME/.default-golang-pkgs \
&& echo ". ~/.asdf/plugins/golang/set-env.bash" \
>> $WSUSER_HOME/.bashrc \
\
&& asdf plugin add \
nodejs \
https://github.com/asdf-vm/asdf-nodejs.git \
&& touch $WSUSER_HOME/.default-npm-packages \
\
&& asdf plugin add \
ruby \
https://github.com/asdf-vm/asdf-ruby.git \
&& touch $WSUSER_HOME/.default-gems \
\
&& asdf plugin add \
rust \
https://github.com/code-lever/asdf-rust.git \
&& touch $WSUSER_HOME/.default-cargo-crates \
\
&& asdf plugin add \
pipx \
https://github.com/yozachar/asdf-pipx.git \
&& echo "export USE_EMOJI=false" \
>> $WSUSER_HOME/.bashrc \
\
&& patch -p0 --verbose < asdf-vm.patch \
&& rm -vf asdf-vm.patch
# -- about 4 hours
# __________________________________________
# __ _ _
# / ) / /| /
# ---/---------/| /-|-----__----/-__-----__-
# / / |/ | / ) /( /___)
# _(____/____/__/___|__(___(__/___\___(___ _
#
#
# ############################################################################
# ┏┓┓ ┓
# All architectures maintenance for CMake configuration system ┣┫┃ ┃
# ┛┗┗┛┗┛
# ############################################################################
FROM base AS cmake-all
#
# CMake runtime versions
# https://cmake.org/download/#latest
# https://cmake.org/cmake/help/latest/release/index.html
# https://gitlab.kitware.com/cmake/community/-/wikis/home#specific
# https://github.com/asdf-community/asdf-cmake
# https://github.com/asdf-community/asdf-cmake/commits
#
# Define CMake versions to be installed via ASDF
ENV TSN_ASDF_CMAKE_VERSION_320=3.20.6
ENV TSN_ASDF_CMAKE_VERSION_330=3.30.5
ENV TSN_ASDF_CMAKE_VERSION=$TSN_ASDF_CMAKE_VERSION_330
# ############################################################################
# Install CMake versions and set default version
RUN asdf install cmake $TSN_ASDF_CMAKE_VERSION_320 \
&& asdf global cmake $TSN_ASDF_CMAKE_VERSION_320 \
&& asdf reshim cmake \
\
&& asdf install cmake $TSN_ASDF_CMAKE_VERSION_330 \
&& asdf global cmake $TSN_ASDF_CMAKE_VERSION_330 \
&& asdf reshim cmake \
\
&& asdf local cmake $TSN_ASDF_CMAKE_VERSION \
&& asdf list cmake \
\
&& cpack --version \
&& ctest --version \
&& cmake --version \
&& cmake --system-information
# ############################################################################
# ┏┓┳┳┓┏┓┓
# Final maintenance for CMake configuration system ┣ ┃┃┃┣┫┃
# ┻ ┻┛┗┛┗┗┛
# ############################################################################
FROM cmake-all AS cmake
# Adding labels for external usage
LABEL cmake.version_320=$TSN_ASDF_CMAKE_VERSION_320
LABEL cmake.version_330=$TSN_ASDF_CMAKE_VERSION_330
LABEL cmake.version=$TSN_ASDF_CMAKE_VERSION
# -- about 5 minutes
# _______________________________________
# _ _
# /| / , ,
# ---/-| -/-----------__--------------__-
# / | / / / ) / / )
# _/___|/_____/____/___/______/____(___(_
# /
# (_ /
# ############################################################################
# ┏┓┓ ┓
# All architectures maintenance for Ninja build system ┣┫┃ ┃
# ┛┗┗┛┗┛
# ############################################################################
FROM cmake AS ninja-all
#
# Ninja runtime versions
# https://ninja-build.org/
# https://github.com/ninja-build/ninja/releases
# https://github.com/asdf-community/asdf-ninja
# https://github.com/asdf-community/asdf-ninja/commits
#
# ############################################################################
#
# AMD/x86 64-bit architecture maintenance for /||\/||\ / /|
# Ninja build system /-|| ||/(_)~|~
#
# ############################################################################
FROM ninja-all AS ninja-amd64
# Define Ninja versions to be installed via ASDF
ENV TSN_ASDF_NINJA_VERSION=1.12.1
# ############################################################################
# Install Ninja versions and set default version
RUN asdf install ninja $TSN_ASDF_NINJA_VERSION \
&& asdf global ninja $TSN_ASDF_NINJA_VERSION \
&& asdf reshim ninja \
\
&& asdf local ninja $TSN_ASDF_NINJA_VERSION \
&& asdf list ninja \
\
&& ninja --version
# ############################################################################
#
# ARMv7 32-bit architecture maintenance for /||)|\/|
# Ninja build system /-||\| |
#
# -- not supported by ASDF plugin, fall back to system package
#
# ############################################################################
FROM ninja-all AS ninja-arm
# Define Ninja version to be installed via Apt/Dpkg
ENV TSN_ASDF_NINJA_VERSION=1.11.1
# ############################################################################
# switch to superuser
USER root
WORKDIR /
# ############################################################################
# Install requirements
RUN apt-get --assume-yes update \
&& apt-get --assume-yes install --no-install-recommends \
ninja-build \
&& apt-get --assume-yes autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
\
&& ninja --version
# ############################################################################
# switch to workspace user
USER $WSUSER_NAME
WORKDIR $WSUSER_HOME
# ############################################################################
#
# ARMv8 64-bit architecture maintenance for /||)|\/| / /|
# Ninja build system /-||\| |(_)~|~
#
# -- HOTFIX: Avoid silent failure, with reason inside of cURL
# <- curl: (55) Send failure: Broken pipe
# <- OpenSSL SSL_write: Broken pipe, errno 32
#
# ############################################################################
FROM ninja-all AS ninja-arm64
# Define Ninja versions to be installed via ASDF
ENV TSN_ASDF_NINJA_VERSION=1.12.1
# ############################################################################
# Install Ninja versions and set default version (with cURL HOTFIX)
RUN echo "--insecure" > $WSUSER_HOME/.curlrc \
&& asdf install ninja $TSN_ASDF_NINJA_VERSION \
&& asdf global ninja $TSN_ASDF_NINJA_VERSION \
&& asdf reshim ninja \
\
&& rm -f $WSUSER_HOME/.curlrc \
\
&& asdf local ninja $TSN_ASDF_NINJA_VERSION \
&& asdf list ninja \
\
&& ninja --version
# ############################################################################
#
# RISC-V 64-bit architecture maintenance for |)|(`/`| // /|
# Ninja build system |\|_)\,|/(_)~|~
#
# -- not supported by ASDF plugin, fall back to system package
#
# ############################################################################
FROM ninja-all AS ninja-riscv64
# Define Ninja version to be installed via Apt/Dpkg
ENV TSN_ASDF_NINJA_VERSION=1.11.1
# ############################################################################
# switch to superuser
USER root
WORKDIR /
# ############################################################################
# Install requirements
RUN apt-get --assume-yes update \
&& apt-get --assume-yes install --no-install-recommends \
ninja-build \
&& apt-get --assume-yes autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
\
&& ninja --version
# ############################################################################
# switch to workspace user
USER $WSUSER_NAME
WORKDIR $WSUSER_HOME
# ############################################################################
#
# IBM POWER8 architecture maintenance for |)|)/` / /| | [~
# Ninja build system | | \,(_)~|~|_[_
#
# -- not supported by ASDF plugin, fall back to system package
#
# ############################################################################
FROM ninja-all AS ninja-ppc64le
# Define Ninja version to be installed via Apt/Dpkg
ENV TSN_ASDF_NINJA_VERSION=1.11.1
# ############################################################################
# switch to superuser
USER root
WORKDIR /
# ############################################################################
# Install requirements
RUN apt-get --assume-yes update \
&& apt-get --assume-yes install --no-install-recommends \
ninja-build \
&& apt-get --assume-yes autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
\
&& ninja --version
# ############################################################################
# switch to workspace user
USER $WSUSER_NAME
WORKDIR $WSUSER_HOME
# ############################################################################
#
# IBM z-Systems architecture maintenance for (`')(~)/\\/
# Ninja build system _).) / \//\
#
# -- not supported by ASDF plugin, fall back to system package
#
# ############################################################################
FROM ninja-all AS ninja-s390x
# Define Ninja version to be installed via Apt/Dpkg
ENV TSN_ASDF_NINJA_VERSION=1.11.1
# ############################################################################
# switch to superuser
USER root
WORKDIR /
# ############################################################################
# Install requirements
RUN apt-get --assume-yes update \
&& apt-get --assume-yes install --no-install-recommends \
ninja-build \
&& apt-get --assume-yes autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
\
&& ninja --version
# ############################################################################
# switch to workspace user
USER $WSUSER_NAME
WORKDIR $WSUSER_HOME
# ############################################################################
# ┏┓┳┳┓┏┓┓
# Final maintenance for Ninja build system ┣ ┃┃┃┣┫┃
# ┻ ┻┛┗┛┗┗┛
# ############################################################################
FROM ninja-${TARGETARCH} AS ninja
# Adding labels for external usage
LABEL ninja.version=$TSN_ASDF_NINJA_VERSION
# -- about 10 minutes
# ______________________________
# ____
# / )
# ---/___ /------------__---_/_-
# / | / / (_ ` /
# _/_____|___(___(___(__)__(_ __
#
#
# ############################################################################
# ┏┓┓ ┓
# All architectures maintenance for Rust runtime environments ┣┫┃ ┃
# ┛┗┗┛┗┛
# ############################################################################
FROM ninja AS rust-all
#
# Rust runtime versions
# https://releases.rs/
# https://github.com/code-lever/asdf-rust
# https://github.com/code-lever/asdf-rust/commits
#
# Define Rust versions to be installed via ASDF
ENV TSN_ASDF_RUST_VERSION_2022=1.67.1
ENV TSN_ASDF_RUST_VERSION_2023=1.76.0
ENV TSN_ASDF_RUST_VERSION_2024=1.82.0
ENV TSN_ASDF_RUST_VERSION=$TSN_ASDF_RUST_VERSION_2023
# ############################################################################
# Install Rust versions and set default version
RUN asdf install rust $TSN_ASDF_RUST_VERSION_2022 \
&& asdf global rust $TSN_ASDF_RUST_VERSION_2022 \
&& asdf reshim rust \
\
&& asdf install rust $TSN_ASDF_RUST_VERSION_2023 \
&& asdf global rust $TSN_ASDF_RUST_VERSION_2023 \
&& asdf reshim rust \
\
&& asdf install rust $TSN_ASDF_RUST_VERSION_2024 \
&& asdf global rust $TSN_ASDF_RUST_VERSION_2024 \
&& asdf reshim rust \
\
&& asdf local rust $TSN_ASDF_RUST_VERSION \
&& asdf list rust \
\
&& cargo --version \
&& cargo-fmt --version \
&& cargo-clippy --version \
&& rustfmt --version \
&& rustdoc --version \
&& rustc --version \
&& rustup --version \
&& rustup component list --installed \
&& rustup target list --installed \
&& rustup toolchain list --verbose \
&& rustup show active-toolchain \
&& rustup show home
# ############################################################################
# ┏┓┳┳┓┏┓┓
# Final maintenance for Rust runtime environments ┣ ┃┃┃┣┫┃
# ┻ ┻┛┗┛┗┗┛
# ############################################################################
FROM rust-all AS rust
# Adding labels for external usage
LABEL rust.version_2022=$TSN_ASDF_RUST_VERSION_2022
LABEL rust.version_2023=$TSN_ASDF_RUST_VERSION_2023
LABEL rust.version_2024=$TSN_ASDF_RUST_VERSION_2024
LABEL rust.version=$TSN_ASDF_RUST_VERSION
# -- about 2 hours
# ____________________________________________
# ____
# / ) /
# ---/____/----------_/_----/__-----__-----__-
# / / / / / ) / ) / )
# _/_________(___/__(_ ___/___/__(___/__/___/_
# /
# (_ /
# ############################################################################
# ┏┓┓ ┓
# All architectures maintenance for Python runtime environments ┣┫┃ ┃
# ┛┗┗┛┗┛
# ############################################################################
FROM rust AS python-all
#
# Python runtime versions
# https://www.python.org/downloads
# https://devguide.python.org/versions
# https://github.com/asdf-community/asdf-python
# https://github.com/asdf-community/asdf-python/commits
#
# Define Python package versions to be installed via pip
# - https://pypi.org/project/pip/24.3.1
# - https://pypi.org/project/setuptools/75.3.0
# - https://pypi.org/project/virtualenv/20.27.1
# - https://pypi.org/project/wheel/0.44.0
# - https://pypi.org/project/poetry/1.8.4
# - https://pypi.org/project/west/1.3.0
ENV TSN_ASDF_PYPI_PIP_VERSION=24.3.1
ENV TSN_ASDF_PYPI_SETUPTOOLS_VERSION=75.3.0
ENV TSN_ASDF_PYPI_VIRTUALENV_VERSION=20.27.1
ENV TSN_ASDF_PYPI_WHEEL_VERSION=0.44.0
ENV TSN_ASDF_PYPI_POETRY_VERSION=1.8.4
ENV TSN_ASDF_PYPI_WEST_VERSION=1.3.0
# Define CPython default behaviour for compilations (shared libraries)
# ENV PYTHON_BUILD_OPTS="--verbose"
ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
# ############################################################################
#
# AMD/x86 64-bit architecture maintenance for /||\/||\ / /|
# Python runtime environments /-|| ||/(_)~|~
#
# ############################################################################
FROM python-all AS python-amd64
# Define Python versions to be installed via ASDF
ENV TSN_ASDF_PYTHON_VERSION_310=3.10.15
ENV TSN_ASDF_PYTHON_VERSION_312=3.12.7
ENV TSN_ASDF_PYTHON_VERSION_313=3.13.0
ENV TSN_ASDF_PYTHON_VERSION=$TSN_ASDF_PYTHON_VERSION_312
### NOT YET ### # Define CPython default optimization for compilations (PGO and LTO active)
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-optimizations"
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-lto"
# ############################################################################
# Install Python versions and set default version
RUN echo "pip==$TSN_ASDF_PYPI_PIP_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "setuptools==$TSN_ASDF_PYPI_SETUPTOOLS_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "virtualenv==$TSN_ASDF_PYPI_VIRTUALENV_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "wheel==$TSN_ASDF_PYPI_WHEEL_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "poetry==$TSN_ASDF_PYPI_POETRY_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "west==$TSN_ASDF_PYPI_WEST_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_310 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_310 \
&& asdf reshim python \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_312 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_312 \
&& asdf reshim python \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_313 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_313 \
&& asdf reshim python \
\
&& asdf local python $TSN_ASDF_PYTHON_VERSION \
&& asdf list python \
\
&& pip --version \
&& pip3 --version \
&& pip3.12 --version \
&& python --version \
&& python3 --version \
&& python3.12 --version \
&& python-config --help \
&& python3-config --help \
&& python3.12-config --help \
&& pip list --verbose
# ############################################################################
# Adding labels for external usage
LABEL python.version_310=$TSN_ASDF_PYTHON_VERSION_310
LABEL python.version_312=$TSN_ASDF_PYTHON_VERSION_312
LABEL python.version_313=$TSN_ASDF_PYTHON_VERSION_313
# ############################################################################
#
# ARMv7 32-bit architecture maintenance for /||)|\/|
# Python runtime environments /-||\| |
#
# ############################################################################
FROM python-all AS python-arm
# Define Python versions to be installed via ASDF
ENV TSN_ASDF_PYTHON_VERSION_312=3.12.7
ENV TSN_ASDF_PYTHON_VERSION=$TSN_ASDF_PYTHON_VERSION_312
### NOT YET ### # Define CPython default optimization for compilations (PGO and LTO active)
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-optimizations"
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-lto"
# ############################################################################
# Install Python versions and set default version
RUN echo "pip==$TSN_ASDF_PYPI_PIP_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "setuptools==$TSN_ASDF_PYPI_SETUPTOOLS_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "virtualenv==$TSN_ASDF_PYPI_VIRTUALENV_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "wheel==$TSN_ASDF_PYPI_WHEEL_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "poetry==$TSN_ASDF_PYPI_POETRY_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "west==$TSN_ASDF_PYPI_WEST_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION \
&& asdf global python $TSN_ASDF_PYTHON_VERSION \
&& asdf reshim python \
\
&& asdf local python $TSN_ASDF_PYTHON_VERSION \
&& asdf list python \
\
&& pip --version \
&& pip3 --version \
&& pip3.12 --version \
&& python --version \
&& python3 --version \
&& python3.12 --version \
&& python-config --help \
&& python3-config --help \
&& python3.12-config --help \
&& pip list --verbose
# ############################################################################
# Adding labels for external usage
LABEL python.version_312=$TSN_ASDF_PYTHON_VERSION_312
# ############################################################################
#
# ARMv8 64-bit architecture maintenance for /||)|\/| / /|
# Python runtime environments /-||\| |(_)~|~
#
# ############################################################################
FROM python-all AS python-arm64
# Define Python versions to be installed via ASDF
ENV TSN_ASDF_PYTHON_VERSION_310=3.10.15
ENV TSN_ASDF_PYTHON_VERSION_312=3.12.7
ENV TSN_ASDF_PYTHON_VERSION_313=3.13.0
ENV TSN_ASDF_PYTHON_VERSION=$TSN_ASDF_PYTHON_VERSION_312
### NOT YET ### # Define CPython default optimization for compilations (PGO and LTO active)
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-optimizations"
### NOT YET ### ENV PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-lto"
# ############################################################################
# Install Python versions and set default version
RUN echo "pip==$TSN_ASDF_PYPI_PIP_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "setuptools==$TSN_ASDF_PYPI_SETUPTOOLS_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "virtualenv==$TSN_ASDF_PYPI_VIRTUALENV_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "wheel==$TSN_ASDF_PYPI_WHEEL_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "poetry==$TSN_ASDF_PYPI_POETRY_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
&& echo "west==$TSN_ASDF_PYPI_WEST_VERSION" \
>> $WSUSER_HOME/.default-python-packages \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_310 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_310 \
&& asdf reshim python \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_312 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_312 \
&& asdf reshim python \
\
&& asdf install python $TSN_ASDF_PYTHON_VERSION_313 \
&& asdf global python $TSN_ASDF_PYTHON_VERSION_313 \
&& asdf reshim python \
\
&& asdf local python $TSN_ASDF_PYTHON_VERSION \
&& asdf list python \
\
&& pip --version \
&& pip3 --version \
&& pip3.12 --version \
&& python --version \
&& python3 --version \
&& python3.12 --version \
&& python-config --help \
&& python3-config --help \
&& python3.12-config --help \
&& pip list --verbose
# ############################################################################
# Adding labels for external usage
LABEL python.version_310=$TSN_ASDF_PYTHON_VERSION_310
LABEL python.version_312=$TSN_ASDF_PYTHON_VERSION_312
LABEL python.version_313=$TSN_ASDF_PYTHON_VERSION_313
# ############################################################################
#
# RISC-V 64-bit architecture maintenance for |)|(`/`| // /|
# Python runtime environments |\|_)\,|/(_)~|~
#
# ############################################################################
FROM python-all AS python-riscv64
# Define Python versions to be installed via ASDF
ENV TSN_ASDF_PYTHON_VERSION_312=3.12.7
ENV TSN_ASDF_PYTHON_VERSION=$TSN_ASDF_PYTHON_VERSION_312