forked from a13xp0p0v/kernel-build-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_containers.sh
executable file
·100 lines (81 loc) · 2.37 KB
/
build_containers.sh
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
#!/bin/bash
groups | grep docker
NEED_SUDO=$?
if [ $NEED_SUDO -eq 1 ]
then
echo "Hey, we gonna use sudo for running docker"
SUDO_CMD="sudo"
else
echo "Hey, you are in docker group, sudo is not needed"
SUDO_CMD=""
fi
set -e
build_gcc_container ()
{
echo -e "\nBuilding a container with GCC_VERSION=$1 from UBUNTU_VERSION=$2"
$SUDO_CMD docker build \
--build-arg GCC_VERSION=$1 \
--build-arg UBUNTU_VERSION=$2 \
--build-arg UNAME=$(id -nu) \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
-t kernel-build-container:gcc-${GCC_VERSION} .
}
GCC_VERSION="4.9"
UBUNTU_VERSION="16.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="5"
UBUNTU_VERSION="16.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="6"
UBUNTU_VERSION="18.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="7"
UBUNTU_VERSION="18.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="8"
UBUNTU_VERSION="20.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="9"
UBUNTU_VERSION="20.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="10"
UBUNTU_VERSION="20.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="11"
UBUNTU_VERSION="22.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="12"
UBUNTU_VERSION="22.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
GCC_VERSION="13"
UBUNTU_VERSION="23.04"
build_gcc_container ${GCC_VERSION} ${UBUNTU_VERSION}
build_clang_container ()
{
echo -e "\nBuilding a container with CLANG_VERSION=$1 and GCC_VERSION=$2 from UBUNTU_VERSION=$3"
$SUDO_CMD docker build \
--build-arg CLANG_VERSION=$1 \
--build-arg GCC_VERSION=$2 \
--build-arg UBUNTU_VERSION=$3 \
--build-arg UNAME=$(id -nu) \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
-t kernel-build-container:clang-${CLANG_VERSION} .
}
CLANG_VERSION="12"
GCC_VERSION="11"
UBUNTU_VERSION="22.04"
build_clang_container ${CLANG_VERSION} ${GCC_VERSION} ${UBUNTU_VERSION}
CLANG_VERSION="13"
GCC_VERSION="11"
UBUNTU_VERSION="22.04"
build_clang_container ${CLANG_VERSION} ${GCC_VERSION} ${UBUNTU_VERSION}
CLANG_VERSION="14"
GCC_VERSION="12"
UBUNTU_VERSION="22.04"
build_clang_container ${CLANG_VERSION} ${GCC_VERSION} ${UBUNTU_VERSION}
CLANG_VERSION="15"
GCC_VERSION="12"
UBUNTU_VERSION="22.04"
build_clang_container ${CLANG_VERSION} ${GCC_VERSION} ${UBUNTU_VERSION}