@@ -5,15 +5,10 @@ set -o pipefail
55# shellcheck source=docker/linux/common_fun.sh
66. ./common_fun.sh
77
8-
9- # Mobile and repo variables
10- APT_KEYS_MOBILE=(
11- " $APT_KEY_AZUL " )
128COMMON_PACKAGES=(
139 apt-transport-https
1410 ca-certificates
1511 curl
16- libtinfo5
1712 patch)
1813CI_PACKAGES=(git gosu sudo)
1914DEBIAN_PACKAGES=(
@@ -26,8 +21,11 @@ DEBIAN_PACKAGES=(
2621 docker-ce-cli
2722 doxygen
2823 expect
24+ g++-13
2925 gdb
3026 git
27+ gnupg2
28+ gpg-agent
3129 graphviz
3230 jq
3331 libcap2-bin
@@ -45,50 +43,45 @@ DEBIAN_PACKAGES=(
4543 tshark
4644 unzip
4745 xz-utils
48- zip)
46+ zip
47+ yq)
4948DOCKER_PACKAGES=(
5049 containerd.io
5150 docker-buildx-plugin
5251 docker-ce
5352 docker-ce-cli
5453 docker-compose-plugin
5554 expect
56- fuse-overlayfs
5755 gettext
5856 jq
5957 netcat-openbsd
6058 skopeo
61- whois)
59+ whois
60+ yq)
6261GROUP_ID=" ${GROUP_ID:- ${USER_ID:- 1000} } "
6362USER_ID=" ${USER_ID:- 1000} "
6463USER_NAME=" ${USER_NAME:- envoybuild} "
6564WORKER_PACKAGES=(autoconf automake libtool m4)
6665
67- # This is used for mobile installs - we need to add the key properly
68- add_ubuntu_keys () {
69- apt-get update -y
70- for key in " ${@ } " ; do
71- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys " $key "
72- done
73- }
74-
75- add_apt_key () {
76- apt-get update -y
77- wget -q -O - " $1 " | apt-key add -
78- }
66+ add_apt_key () {
67+ local key_url=" $1 "
68+ local key_id=" $2 "
69+ local key_path=" /usr/share/keyrings/${key_id} .gpg"
7970
80- add_apt_k8s_key () {
81- apt-get update -y
82- wget -q -O - " $1 " | gpg --dearmor > /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_stable.gpg
71+ echo " Add apt key( ${key_id} ): ${key_url} " >&2
72+ wget -qO - " $key_url " | gpg --dearmor | sudo tee " $key_path " > /dev/null
73+ echo -n " $key_path "
8374}
8475
8576add_apt_repos () {
8677 local repo
78+
8779 apt-get update -y
8880 apt-get -qq install -y ca-certificates
8981 for repo in " ${@ } " ; do
9082 echo " deb ${repo} " >> " /etc/apt/sources.list"
9183 done
84+ cat /etc/apt/sources.list
9285 apt-get update -y
9386}
9487
@@ -104,6 +97,11 @@ install_base () {
10497 echo " Installing common packages..."
10598 apt_install " ${COMMON_PACKAGES[@]} "
10699
100+ # Workaround https://github.com/llvm/llvm-project/issues/75490
101+ curl -LO " http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_${DEB_ARCH} .deb"
102+ dpkg -i " libtinfo5_6.4-4_${DEB_ARCH} .deb"
103+ rm " libtinfo5_6.4-4_${DEB_ARCH} .deb"
104+
107105 # Workaround for https://github.com/llvm/llvm-project/issues/113696
108106 if [[ " $DEB_ARCH " == " arm64" ]]; then
109107 WORKER_PACKAGES+=(libxml2)
@@ -144,34 +142,24 @@ mobile_install_jdk () {
144142}
145143
146144mobile_install () {
147- add_ubuntu_keys " ${APT_KEYS_MOBILE[@]} "
145+ azul_keypath=" $( add_apt_key https://repos.azul.com/azul-repo.key azul) "
146+ echo " deb [signed-by=${azul_keypath} ] https://repos.azul.com/zulu/deb stable main" \
147+ | sudo tee /etc/apt/sources.list.d/zulu.list
148148 mobile_install_jdk
149149 mobile_install_android
150150}
151151
152152install_devel () {
153153 # Install development tools (no system compilers - toolchains will provide these)
154154 echo " Installing development tools..."
155-
156155 apt-get -qq update -y
157- apt-get -qq install -y --no-install-recommends locales lsb-release
158- if ! locale -a | grep -q en_US.utf8; then
159- localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
160- fi
161- LSB_RELEASE=" $( lsb_release -cs) "
162- APT_REPOS=(
163- " [arch=${DEB_ARCH} ] https://download.docker.com/linux/debian ${LSB_RELEASE} stable"
164- " https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_11/ /" )
165-
166- apt-get -qq install -y --no-install-recommends wget gnupg2 gpg-agent software-properties-common
167- add_apt_key " ${APT_KEY_DOCKER} "
168- add_apt_k8s_key " ${APT_KEY_K8S} "
169- add_apt_repos " ${APT_REPOS[@]} "
170- apt-get -qq update
171156 apt-get -qq install -y --no-install-recommends " ${DEBIAN_PACKAGES[@]} "
172157 apt-get -qq update
173158 apt-get -qq upgrade -y
174159
160+ apt_install " ${DEV_PACKAGES[@]} "
161+ apt-get -qq dist-upgrade -y
162+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 1
175163 install_build
176164
177165 echo " Development tools installation completed - compilers provided by toolchains"
@@ -191,22 +179,19 @@ install_bazelisk () {
191179
192180install_docker () {
193181 apt-get -qq update -y
194- apt-get -qq install -y --no-install-recommends locales lsb-release
182+ apt-get -qq install -y --no-install-recommends gpg locales lsb-release wget
195183 if ! locale -a | grep -q en_US.utf8; then
196184 localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
197185 fi
198- LSB_RELEASE=" $( lsb_release -cs) "
199- APT_REPOS=(
200- " http://archive.debian.org/debian bullseye-backports main"
201- " [arch=${DEB_ARCH} ] https://download.docker.com/linux/debian ${LSB_RELEASE} stable"
202- " https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_11/ /" )
203- apt-get -qq install -y --no-install-recommends wget gnupg2 gpg-agent software-properties-common
204- add_apt_key " ${APT_KEY_DOCKER} "
205- add_apt_k8s_key " ${APT_KEY_K8S} "
206- add_apt_repos " ${APT_REPOS[@]} "
186+ lsb_release=" $( lsb_release -cs) "
187+ docker_key=$( add_apt_key " ${APT_KEY_DOCKER} " docker)
188+ k8s_key=$( add_apt_key " ${APT_KEY_K8S} " k8s)
189+ apt_repos=(
190+ " [arch=${DEB_ARCH} signed-by=${docker_key} ] https://download.docker.com/linux/debian ${lsb_release} stable"
191+ " [signed-by=${k8s_key} ] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Testing/ /" )
192+ add_apt_repos " ${apt_repos[@]} "
207193 apt-get -qq update
208194 apt-get -qq install -y --no-install-recommends " ${DOCKER_PACKAGES[@]} "
209- apt-get -qq install -y --no-install-recommends -t bullseye-backports curl yq
210195 apt-get -qq update
211196 apt-get -qq upgrade -y
212197}
0 commit comments