Skip to content

Commit 4b5eda6

Browse files
authored
fix: building bionic arm agents (microsoft#30)
1 parent 0cc33a0 commit 4b5eda6

File tree

5 files changed

+22
-59
lines changed

5 files changed

+22
-59
lines changed

azure-pipelines.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ jobs:
5757
parameters:
5858
arch: bionic-armhf
5959

60-
- job: stretch_armhf
61-
pool:
62-
vmImage: 'ubuntu-latest'
63-
steps:
64-
- template: build.yml
65-
parameters:
66-
arch: stretch-armhf
67-
6860
- job: snapcraft_x64
6961
pool:
7062
vmImage: 'ubuntu-latest'

bionic-arm64/Dockerfile

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
22
ARG TAG=18.04
33
FROM ${REPO}:${TAG}
44

5+
ARG DEBIAN_FRONTEND=noninteractive
6+
57
# ubuntu keeps its i386/amd64 and other architecture repos separate
68
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
79
# add the required repos for armhf/arm64 and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
@@ -11,7 +13,10 @@ RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main u
1113
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
1214
RUN dpkg --add-architecture arm64
1315
RUN apt-get update && apt-get install -y --no-install-recommends \
14-
gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu gfortran-8-aarch64-linux-gnu binutils-aarch64-linux-gnu \
16+
gcc-8-aarch64-linux-gnu \
17+
g++-8-aarch64-linux-gnu \
18+
binutils-aarch64-linux-gnu \
19+
build-essential \
1520
git \
1621
pkg-config \
1722
fakeroot \
@@ -25,32 +30,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2530
libsecret-1-dev:arm64 \
2631
curl \
2732
gnupg \
28-
unzip \
29-
# Dependencies for building python from source
30-
build-essential \
31-
libreadline-gplv2-dev \
32-
libncursesw5-dev \
33-
libssl-dev \
34-
libsqlite3-dev \
35-
tk-dev \
36-
libgbm-dev \
37-
libc6-dev \
38-
libbz2-dev \
39-
libffi-dev \
40-
zlib1g-dev
33+
unzip
4134

42-
# Compile python3.9 from source
43-
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
44-
RUN tar -xf Python-3.9.4.tar.xz
45-
RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall
46-
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
35+
# Set python3 as default
36+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
4737
RUN python --version
4838

49-
# Remove expired CA cert for openSSL 1.0.2
50-
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
51-
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
52-
RUN update-ca-certificates --fresh
53-
5439
# Yarn
5540
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
5641
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@@ -62,5 +47,4 @@ ENV AS=/usr/bin/aarch64-linux-gnu-as \
6247
CPP=/usr/bin/aarch64-linux-gnu-cpp-8 \
6348
CXX=/usr/bin/aarch64-linux-gnu-g++-8 \
6449
LD=/usr/bin/aarch64-linux-gnu-ld \
65-
FC=/usr/bin/aarch64-linux-gnu-gfortran-8 \
6650
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig

bionic-armhf/Dockerfile

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
22
ARG TAG=18.04
33
FROM ${REPO}:${TAG}
44

5+
ARG DEBIAN_FRONTEND=noninteractive
6+
57
# ubuntu keeps its i386/amd64 and other architecture repos separate
68
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
79
# add the required repos for armhf/arm64 and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
@@ -11,7 +13,10 @@ RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main u
1113
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
1214
RUN dpkg --add-architecture armhf
1315
RUN apt-get update && apt-get install -y --no-install-recommends \
14-
gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf gfortran-8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf \
16+
gcc-8-arm-linux-gnueabihf \
17+
g++-8-arm-linux-gnueabihf \
18+
binutils-arm-linux-gnueabihf \
19+
build-essential \
1520
git \
1621
pkg-config \
1722
fakeroot \
@@ -25,32 +30,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2530
libsecret-1-dev:armhf \
2631
curl \
2732
gnupg \
28-
unzip \
29-
# Dependencies for building python from source
30-
build-essential \
31-
libreadline-gplv2-dev \
32-
libncursesw5-dev \
33-
libssl-dev \
34-
libsqlite3-dev \
35-
tk-dev \
36-
libgbm-dev \
37-
libc6-dev \
38-
libbz2-dev \
39-
libffi-dev \
40-
zlib1g-dev
33+
unzip
4134

42-
# Compile python3.9 from source
43-
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
44-
RUN tar -xf Python-3.9.4.tar.xz
45-
RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall
46-
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
35+
# Set python3 as default
36+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
4737
RUN python --version
4838

49-
# Remove expired CA cert for openSSL 1.0.2
50-
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
51-
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
52-
RUN update-ca-certificates --fresh
53-
5439
# Yarn
5540
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
5641
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@@ -62,5 +47,4 @@ ENV AS=/usr/bin/arm-linux-gnueabihf-as \
6247
CPP=/usr/bin/arm-linux-gnueabihf-cpp-8 \
6348
CXX=/usr/bin/arm-linux-gnueabihf-g++-8 \
6449
LD=/usr/bin/arm-linux-gnueabihf-ld \
65-
FC=/usr/bin/arm-linux-gnueabihf-gfortran-8 \
6650
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig

focal-x64/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y \
2020
apt-transport-https \
2121
ca-certificates \
2222
curl \
23+
file \
2324
git \
2425
gnome-keyring \
2526
iproute2 \
@@ -44,9 +45,11 @@ RUN apt-get update && apt-get install -y \
4445
tzdata \
4546
unzip \
4647
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.sh \
48+
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.py \
4749
# Remove snapcraft to avoid issues on docker build
48-
&& sed -i 's/${dev_list} snapcraft/${dev_list}/g' /setup/install-build-deps.sh \
50+
&& sed -i 's/packages.append("snapcraft")/#packages.append("snapcraft")/g' /setup/install-build-deps.py \
4951
&& chmod +x /setup/install-build-deps.sh \
52+
&& chmod +x /setup/install-build-deps.py \
5053
&& bash /setup/install-build-deps.sh --no-syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \
5154
&& rm -rf /var/lib/apt/lists/*
5255

0 commit comments

Comments
 (0)