-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathDockerfile
972 lines (895 loc) · 26.1 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
# Copyright 2019 Garmin Ltd. or its subsidiaries
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG PYREX_BASE=ubuntu-20.04-oe
#
# Base image for prebuilt static binaries
#
FROM alpine:3.9 AS prebuilt-base
ENV PYREX_BASE none
RUN apk add --update \
acl-dev \
alpine-sdk \
autoconf \
automake \
bash \
bzip2-dev \
cmake \
expat-dev \
file \
libarchive-dev \
libcap-ng-dev \
libtool \
lz4-dev \
lzo-dev \
musl-utils \
openssl-dev \
wget \
xz \
xz-dev \
zlib-dev \
zstd-dev \
zstd-static \
;
RUN mkdir -p /dist
RUN mkdir -p /usr/src
COPY patches/0001-Use-pkg-config-to-find-packages.patch /usr/src/
#
# Prebuilt static icecream
#
FROM prebuilt-base AS prebuilt-icecream
ENV PYREX_BASE none
ENV ICECREAM_SHA1=6eec038c11a821b1d2848e8197cbc5b6bca6b3a0
RUN mkdir -p /usr/src/icecream && \
cd /usr/src/icecream && \
wget -O icecream.tar.gz https://github.com/icecc/icecream/archive/${ICECREAM_SHA1}.tar.gz && \
tar -xvzf icecream.tar.gz && \
cd icecream-${ICECREAM_SHA1} && \
patch -p1 < /usr/src/0001-Use-pkg-config-to-find-packages.patch && \
mkdir build && \
cd build && \
../autogen.sh && \
../configure --prefix=/usr/local/ \
--enable-gcc-color-diagnostics \
--enable-gcc-show-caret \
--enable-gcc-fdirectives-only \
--enable-clang-rewrite-includes \
--without-man \
--enable-static \
--disable-shared \
LDFLAGS="-static" \
PKG_CONFIG="pkg-config --static" && \
make -j$(nproc) LDFLAGS="--static" && \
make install-strip DESTDIR=/dist/icecream
#
# Prebuilt static setpriv
#
FROM prebuilt-base AS prebuilt-setpriv
ENV PYREX_BASE none
RUN mkdir -p /usr/src/util-linux && \
cd /usr/src/util-linux && \
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.1.tar.xz && \
tar -xvf util-linux-2.36.1.tar.xz && \
cd util-linux-2.36.1 && \
wget https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/patch/?id=8bf68f78d8a3c470e5a326989aa3e78385e1e79b -O setpriv_all_cap.patch && \
patch -p1 < setpriv_all_cap.patch && \
mkdir build && \
cd build && \
../configure \
--disable-all-programs \
--enable-setpriv \
--disable-doc \
LDFLAGS="-static" \
--disable-nls \
--without-bashcompletion \
--prefix=/usr/local && \
make -j$(nproc) LDFLAGS="--static" && \
make install-strip DESTDIR=/dist/setpriv
#
# Prebuilt util-linux and libcap-ng for Ubuntu 14.04
#
FROM ubuntu:trusty AS prebuilt-util-linux-14.04
ENV PYREX_BASE none
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
build-essential \
wget
# Work around Let's Encrypt certificate expiration September 2021
RUN sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && \
update-ca-certificates
RUN set -x && mkdir -p /usr/src/libcap-ng && \
cd /usr/src/libcap-ng && \
wget http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-0.8.2.tar.gz && \
tar -xvf libcap-ng-0.8.2.tar.gz && \
cd libcap-ng-0.8.2 && \
mkdir build && \
cd build && \
../configure --prefix=/usr/local && \
make -j$(nproc) LDFLAGS="-lpthread" && \
make install-strip
RUN set -x && mkdir -p /usr/src/util-linux && \
cd /usr/src/util-linux && \
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.1.tar.xz && \
tar -xvf util-linux-2.36.1.tar.xz && \
cd util-linux-2.36.1 && \
wget https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/patch/?id=8bf68f78d8a3c470e5a326989aa3e78385e1e79b -O setpriv_all_cap.patch && \
patch -p1 < setpriv_all_cap.patch && \
mkdir build && \
cd build && \
../configure \
--disable-doc \
--disable-nls \
--enable-setpriv \
--without-bashcompletion \
--prefix=/usr/local && \
make -j$(nproc) && \
make install-strip
#
# Prebuilt static tini
#
FROM prebuilt-base as prebuilt-tini
ENV PYREX_BASE none
ENV TINI_SHA1=c3b92ce685d0387c5d508f1856aa6d4cae25db8d
RUN mkdir -p /usr/src/tini && \
cd /usr/src/tini && \
wget -O tini.tar.gz https://github.com/JPEWdev/tini/archive/${TINI_SHA1}.tar.gz && \
tar -xvzf tini.tar.gz && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../tini-${TINI_SHA1} && \
make && \
make install DESTDIR=/dist/tini && \
mv /dist/tini/usr/local/bin/tini-static /dist/tini/usr/local/bin/tini
#
# Ubuntu 14.04 base
#
FROM ubuntu:trusty as ubuntu-14.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
locales \
lsb-release \
ncurses-term \
python \
python3 \
sudo \
curl \
&& \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* &&\
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Work around Let's Encrypt certificate expiration September 2021
RUN sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && \
update-ca-certificates
# Copy prebuilt items
COPY --from=prebuilt-util-linux-14.04 /usr/local/ /usr/local/
COPY --from=prebuilt-tini /dist/tini /
# Rebuild library cache after copying prebuilt utl-linux
RUN ldconfig -v
#
# Ubuntu 16.04 Base
#
FROM ubuntu:xenial as ubuntu-16.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
locales \
lsb-release \
ncurses-term \
python \
python3 \
sudo \
curl \
apt-transport-https \
&& \
# Add packagecloud apt source and gpg key and install git-lfs
# (Depends on curl and apt-transport-https installed above)
install -d -m 0755 -o root -g root /etc/apt/sources.list.d && \
curl -sSf 'https://packagecloud.io/install/repositories/github/git-lfs/config_file.list?os=Ubuntu&dist=xenial&source=script' > /etc/apt/sources.list.d/github_git-lfs.list && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL 'https://packagecloud.io/github/git-lfs/gpgkey' | gpg --dearmor > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg && \
apt-get -y update && \
apt-get -y install git-lfs && \
# Configure git lfs
git lfs install --system > /dev/null 2>&1 && \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* &&\
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Copy prebuilt items
COPY --from=prebuilt-setpriv /dist/setpriv /
COPY --from=prebuilt-tini /dist/tini /
#
# Ubuntu 18.04 Base
#
FROM ubuntu:bionic as ubuntu-18.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
locales \
lsb-release \
ncurses-term \
python \
python3 \
setpriv \
sudo \
curl \
&& \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* && \
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Copy prebuilt items
COPY --from=prebuilt-setpriv /dist/setpriv /
COPY --from=prebuilt-tini /dist/tini /
#
# Ubuntu 20.04 Base
#
FROM ubuntu:focal as ubuntu-20.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
locales \
lsb-release \
ncurses-term \
python \
python3 \
util-linux \
sudo \
curl \
&& \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* && \
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Copy prebuilt items
COPY --from=prebuilt-setpriv /dist/setpriv /
COPY --from=prebuilt-tini /dist/tini /
#
# Ubuntu 22.04 Base
#
FROM ubuntu:jammy as ubuntu-22.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install --no-install-recommends \
locales \
lsb-release \
ncurses-term \
python3 \
util-linux \
sudo \
curl \
ca-certificates \
&& \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* && \
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Copy prebuilt items
COPY --from=prebuilt-setpriv /dist/setpriv /
COPY --from=prebuilt-tini /dist/tini /
#
# Ubuntu 24.04 Base
#
FROM ubuntu:noble as ubuntu-24.04-base
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
# Install software required to run init scripts.
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install --no-install-recommends \
locales \
lsb-release \
ncurses-term \
python3 \
util-linux \
sudo \
curl \
ca-certificates \
&& \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/* && \
# generate utf8 locale
locale-gen en_US.UTF-8 && \
(locale -a | tee /dev/stderr | grep -qx en_US.utf8)
# Copy prebuilt items
COPY --from=prebuilt-setpriv /dist/setpriv /
COPY --from=prebuilt-tini /dist/tini /
#
# Ubuntu 14.04 Yocto Base
#
FROM ubuntu-14.04-base as ubuntu-14.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
# Add a non-ancient version of git
apt-get -y update && apt-get -y install software-properties-common && \
add-apt-repository -y ppa:git-core/ppa && \
apt-get -y update && apt-get -y install \
# Poky 2.0 build dependencies
gawk \
wget \
git-core \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
libsdl1.2-dev \
xterm \
# Poky 2.1 build dependencies
gawk \
wget \
git-core \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
# Poky 2.2 build dependencies
gawk \
wget \
git-core \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Required for some poorly written 3rd party recipes :(
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# An updated version of Git (from the PPA source above)
# that supports doing Yocto externalsrc recipes against free-
# standing working copies that use Git worktrees.
git>=1:2.17.* \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 16.04 Yocto Base
#
FROM ubuntu-16.04-base as ubuntu-16.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
ulimit -n 1024 && \
# Add a non-ancient version of git
apt-get -y update && apt-get -y install software-properties-common && \
add-apt-repository -y ppa:git-core/ppa && \
apt-get -y update && apt-get -y install \
# Poky 2.7 build dependencies
gawk \
wget \
git-core \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
cpio \
python \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libegl1-mesa \
libsdl1.2-dev \
xterm \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Required for some poorly written 3rd party recipes :(
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# An updated version of Git (from the PPA source above)
# that supports doing Yocto externalsrc recipes against free-
# standing working copies that use Git worktrees.
git>=1:2.17.* \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Python modules used by resulttool
RUN python3 -m pip install jinja2 iterfzf==0.5.0.20.0
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 18.04 Base
#
FROM ubuntu-18.04-base as ubuntu-18.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
sudo dpkg --add-architecture i386 && \
ulimit -n 1024 && \
apt-get -y update && apt-get -y install \
# Poky 2.7 build dependencies
gawk \
wget \
git-core \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
cpio \
python \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libegl1-mesa \
libsdl1.2-dev \
xterm \
coreutils \
# Testing dependencies
iproute2 \
sysstat \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Required for some poorly written 3rd party recipes :(
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
# Testing requirements
wine64 \
wine32 \
&& \
# Add packagecloud apt source and gpg key and install git-lfs
install -d -m 0755 -o root -g root /etc/apt/sources.list.d && \
curl -sSf 'https://packagecloud.io/install/repositories/github/git-lfs/config_file.list?os=Ubuntu&dist=bionic&source=script' > /etc/apt/sources.list.d/github_git-lfs.list && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL 'https://packagecloud.io/github/git-lfs/gpgkey' | gpg --dearmor > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg && \
apt-get -y update && \
apt-get -y install git-lfs && \
# Configure git lfs
git lfs install --system > /dev/null 2>&1 && \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/*
# Python modules used by resulttool
RUN python3 -m pip install iterfzf testtools python-subunit
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 20.04 Base
#
FROM ubuntu-20.04-base as ubuntu-20.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
sudo dpkg --add-architecture i386 && \
ulimit -n 1024 && \
apt -y update && apt upgrade apt -y && apt -y install \
# Poky 3.3 build dependencies
gawk \
wget \
git \
diffstat \
unzip \
texinfo \
gcc-multilib \
build-essential \
chrpath \
socat \
cpio \
python \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libegl1-mesa \
libsdl1.2-dev \
pylint3 \
xterm \
coreutils \
python3-subunit \
mesa-common-dev \
zstd \
liblz4-tool \
# Testing dependencies
iproute2 \
sysstat \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Required for some poorly written 3rd party recipes :(
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
# Dependencies for other layers
xxd \
# Testing requirements
wine64 \
wine32 && \
# Add packagecloud apt source and gpg key and install git-lfs
install -d -m 0755 -o root -g root /etc/apt/sources.list.d && \
curl -sSf 'https://packagecloud.io/install/repositories/github/git-lfs/config_file.list?os=Ubuntu&dist=focal&source=script' > /etc/apt/sources.list.d/github_git-lfs.list && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL 'https://packagecloud.io/github/git-lfs/gpgkey' | gpg --dearmor > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg && \
apt-get -y update && \
apt-get -y install git-lfs && \
# Configure git lfs
git lfs install --system > /dev/null 2>&1 && \
# Clean up apt-cache
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install iterfzf testtools python-subunit
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 22.04 Base
#
FROM ubuntu-22.04-base as ubuntu-22.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
sudo dpkg --add-architecture i386 && \
ulimit -n 1024 && \
apt -y update && apt upgrade apt -y && apt -y install --no-install-recommends \
# Poky 4.0 build dependencies
gawk \
wget \
git \
git-lfs \
diffstat \
unzip \
texinfo \
gcc \
build-essential \
chrpath \
socat \
cpio \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libegl1-mesa \
libsdl1.2-dev \
pylint \
xterm \
python3-subunit \
mesa-common-dev \
zstd \
liblz4-tool \
# Testing dependencies
iproute2 \
sysstat \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Required for some poorly written 3rd party recipes :(
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
file \
# Dependencies for other layers
xxd \
# Testing requirements
wine \
wine64 \
wine32 \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install iterfzf testtools python-subunit
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 24.04 Base
#
FROM ubuntu-24.04-base as ubuntu-24.04-oe
ENV PYREX_BASE none
LABEL maintainer="Joshua Watt <[email protected]>"
RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
sudo dpkg --add-architecture i386 && \
ulimit -n 1024 && \
apt -y update && apt upgrade apt -y && apt -y install --no-install-recommends \
# Poky 4.0 build dependencies
gawk \
wget \
git \
git-lfs \
diffstat \
unzip \
texinfo \
gcc \
build-essential \
chrpath \
socat \
cpio \
python3 \
python3-pip \
python3-pexpect \
xz-utils \
debianutils \
iputils-ping \
python3-git \
python3-jinja2 \
libsdl1.2-dev \
pylint \
xterm \
python3-subunit \
python3-testtools \
mesa-common-dev \
zstd \
liblz4-tool \
# Testing dependencies
iproute2 \
sysstat \
# Dependencies for "bitbake -c menuconfig"
libncurses5-dev \
libtinfo-dev \
# Not listed, but required dependencies (from ASSUME_PROVIDED)
bzip2 \
libbz2-dev \
sed \
findutils \
# Required for some poorly written 3rd party recipes :(
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
# Screen to enable devshell
screen \
# Base OS stuff that reasonable workstations have, but which the registry image
# doesn't
tzdata \
file \
# Dependencies for other layers
xxd \
# Testing requirements
wine \
wine64 \
wine32 \
&& rm -rf /var/lib/apt/lists/*
# Copy prebuilt items
COPY --from=prebuilt-icecream /dist/icecream /
#
# Ubuntu 18.04 OE Test Image
#
FROM ubuntu-18.04-oe as ubuntu-18.04-oetest
ENV PYREX_BASE none
#
# Ubuntu 20.04 OE Test Image
#
FROM ubuntu-20.04-oe as ubuntu-20.04-oetest
ENV PYREX_BASE none
#
# Ubuntu 14.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-14.04-oe AS ubuntu-14.04-oegarmin
ENV PYREX_BASE none
#
# Ubuntu 16.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-16.04-oe AS ubuntu-16.04-oegarmin
ENV PYREX_BASE none
#
# Ubuntu 18.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-18.04-oe AS ubuntu-18.04-oegarmin
ENV PYREX_BASE none
#
# Ubuntu 20.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-20.04-oe AS ubuntu-20.04-oegarmin
ENV PYREX_BASE none
#
# Ubuntu 22.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-22.04-oe AS ubuntu-22.04-oegarmin
ENV PYREX_BASE none
#
# Ubuntu 24.04 Base, customized with Garmin internal LAN configuration.
#
FROM ubuntu-24.04-oe AS ubuntu-24.04-oegarmin
ENV PYREX_BASE none
#
# Base image target.
#
# This stage sets up the minimal image startup and entry points. It also
# ensures that the en_US.UTF-8 locale is installed and set correctly.
#
FROM ${PYREX_BASE} as pyrex-base
ENV PYREX_BASE none
# Set Locales
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Add startup scripts
COPY ./run.sh /usr/libexec/pyrex/run
COPY ./capture.sh /usr/libexec/pyrex/capture
COPY ./entry.py /usr/libexec/pyrex/entry.py
COPY ./cleanup.py /usr/libexec/pyrex/cleanup.py
RUN chmod +x /usr/libexec/pyrex/cleanup.py \
/usr/libexec/pyrex/entry.py \
/usr/libexec/pyrex/run \
/usr/libexec/pyrex/capture
# Add startup script directory & test script.
COPY ./test_startup.sh /usr/libexec/pyrex/startup.d/
# Precompile python files for improved startup time
RUN python3 -m py_compile /usr/libexec/pyrex/*.py
# Use tini as the init process and instruct it to invoke the cleanup script
# once the primary command dies
ENTRYPOINT ["/usr/local/bin/tini", "-P", "/usr/libexec/pyrex/cleanup.py", "{}", ";", "--", "/usr/libexec/pyrex/entry.py"]
# The startup script is expected to chain along to some other
# command. By default, we'll use an interactive shell.
CMD ["/usr/libexec/pyrex/run", "/bin/bash"]
#
# Yocto compatible target image.
#
# The final image is the yocto compatible target image. This image has the
# Icecream destributed target setup correctly and install all of the desired
# yocto dependencies.
#
FROM pyrex-base as pyrex-oe
ENV PYREX_BASE none
# Setup Icecream distributed compiling client. The client tries several IPC
# mechanisms to find the daemon, including connecting to a localhost TCP
# socket. Since the local Icecream daemon (iceccd) is not started when the
# container starts, the client will not find it and instead connect to the host
# Icecream daemon (as long as the container is run with --net=host).
RUN mkdir -p /usr/share/icecc/toolchain && \
cd /usr/share/icecc/toolchain/ && \
TC_NAME=$(mktemp) && \
/usr/local/libexec/icecc/icecc-create-env --gcc $(which gcc) $(which g++) 5> $TC_NAME && \
mv $(cat $TC_NAME) native-gcc.tar.gz && \
rm $TC_NAME
ENV ICECC_VERSION=/usr/share/icecc/toolchain/native-gcc.tar.gz
#
# OE build image. Includes many additional packages for testing
#
FROM pyrex-oe as pyrex-oetest
ENV PYREX_BASE none
#
# Garmin developer image. Same as regular Yocto-compatible target image except
# it has additional Garmin-internal TLS root certificates installed into the
# trust store to facilitate using internal Garmin hosts whose certificate chain
# does not extend up to publicly registered CA's.
FROM pyrex-oe as pyrex-oegarmin
ENV PYREX_BASE none
RUN mkdir -p /usr/share/ca-certificates/garmin
# Root certificate that issued the cert for firewall TLS inspection.
# Certificate originally obtained from https://pki.garmin.com/crl/Garmin%20Root%20CA%20-%202018.cer
COPY garmin/Garmin_Root_CA_-_2018.cer /tmp/
RUN openssl x509 -inform DER -in /tmp/Garmin_Root_CA_-_2018.cer -out /usr/share/ca-certificates/garmin/Garmin_Root_CA_-_2018.crt
RUN echo garmin/Garmin_Root_CA_-_2018.crt >> /etc/ca-certificates.conf
RUN rm /tmp/Garmin_Root_CA_-_2018.cer
# Rebuild the CA database
RUN update-ca-certificates