Skip to content

Commit a1e2ed7

Browse files
committed
docker/debian: Add gcc++13 to devtools
Signed-off-by: Ryan Northey <[email protected]>
1 parent 69127c8 commit a1e2ed7

File tree

2 files changed

+46
-62
lines changed

2 files changed

+46
-62
lines changed

docker/linux/debian/Dockerfile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim@sha256:779034981fec838da124ff6ab9211499ba5d4e769dabdfd6c42c6ae2553b9a3b AS worker-base
1+
FROM debian:trixie-slim@sha256:66b37a5078a77098bfc80175fb5eb881a3196809242fd295b25502854e12cbec AS worker-base
22
ARG DEBIAN_FRONTEND=noninteractive
33
SHELL ["/bin/bash", "-ec"]
44
RUN --mount=type=tmpfs,target=/var/cache/apt \
@@ -34,30 +34,30 @@ COPY debian/entrypoint.sh /entrypoint.sh
3434
ENTRYPOINT ["/entrypoint.sh"]
3535

3636

37-
FROM ci-base AS devtools-base
38-
ARG BAZELISK_SHA256SUM=6539c12842ad76966f3d493e8f80d67caa84ec4a000e220d5459833c967c12bc \
39-
BAZELISK_SHA256SUM_ARM64=54f85ef4c23393f835252cc882e5fea596e8ef3c4c2056b059f8067cd19f0351 \
40-
BAZELISK_VERSION=1.26.0 \
41-
APT_KEY_K8S=https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_12/Release.key \
37+
FROM ci-base AS docker-base
38+
ARG APT_KEY_K8S=https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_Testing/Release.key \
4239
APT_KEY_DOCKER=https://download.docker.com/linux/debian/gpg
4340
RUN --mount=type=tmpfs,target=/var/cache/apt \
4441
--mount=type=tmpfs,target=/var/lib/apt/lists \
4542
--mount=type=bind,source=/common_fun.sh,target=/common_fun.sh \
4643
--mount=type=bind,source=/debian/fun.sh,target=/debian/fun.sh \
4744
. ./debian/fun.sh \
48-
&& install_devel
45+
&& install_docker
46+
COPY debian/docker-entrypoint.sh /entrypoint.sh
4947

5048

51-
FROM ci-base AS docker-base
52-
ARG APT_KEY_K8S=https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_12/Release.key \
49+
FROM docker-base AS devtools-base
50+
ARG BAZELISK_SHA256SUM=6539c12842ad76966f3d493e8f80d67caa84ec4a000e220d5459833c967c12bc \
51+
BAZELISK_SHA256SUM_ARM64=54f85ef4c23393f835252cc882e5fea596e8ef3c4c2056b059f8067cd19f0351 \
52+
BAZELISK_VERSION=1.26.0 \
53+
APT_KEY_K8S=https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_Testing/Release.key \
5354
APT_KEY_DOCKER=https://download.docker.com/linux/debian/gpg
5455
RUN --mount=type=tmpfs,target=/var/cache/apt \
5556
--mount=type=tmpfs,target=/var/lib/apt/lists \
5657
--mount=type=bind,source=/common_fun.sh,target=/common_fun.sh \
5758
--mount=type=bind,source=/debian/fun.sh,target=/debian/fun.sh \
5859
. ./debian/fun.sh \
59-
&& install_docker
60-
COPY debian/docker-entrypoint.sh /entrypoint.sh
60+
&& install_devel
6161

6262

6363
FROM devtools-base AS llvm-base
@@ -86,7 +86,6 @@ COPY \
8686
# mobile
8787
FROM llvm-base AS mobile-base
8888
ARG ANDROID_CLI_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip \
89-
APT_KEY_AZUL=0xB1998361219BD9C9 \
9089
ZULU_INSTALL_DEB=https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb
9190
ENV ANDROID_HOME=/.android/sdk \
9291
ANDROID_NDK_HOME=/.android/sdk/ndk/26.3.11579264 \

docker/linux/debian/fun.sh

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -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")
128
COMMON_PACKAGES=(
139
apt-transport-https
1410
ca-certificates
1511
curl
16-
libtinfo5
1712
patch)
1813
CI_PACKAGES=(git gosu sudo)
1914
DEBIAN_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)
4948
DOCKER_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)
6261
GROUP_ID="${GROUP_ID:-${USER_ID:-1000}}"
6362
USER_ID="${USER_ID:-1000}"
6463
USER_NAME="${USER_NAME:-envoybuild}"
6564
WORKER_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

8576
add_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

146144
mobile_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

152152
install_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

192180
install_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

Comments
 (0)