Skip to content

Commit 0cc33a0

Browse files
Add Ubuntu 18.04 images for armhf/arm64 (microsoft#29)
* ci: add ubuntu bionic for armhf/arm64 * Apply suggestions from code review Co-authored-by: Robo <hop2deep@gmail.com> --------- Co-authored-by: Robo <hop2deep@gmail.com>
1 parent f29bb53 commit 0cc33a0

File tree

5 files changed

+136
-4
lines changed

5 files changed

+136
-4
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ jobs:
4141
qemu: 'true'
4242
arch: alpine-arm64
4343

44-
- job: buster_arm64
44+
- job: bionic_arm64
4545
pool:
4646
vmImage: 'ubuntu-latest'
4747
steps:
4848
- template: build.yml
4949
parameters:
50-
arch: buster-arm64
50+
arch: bionic-arm64
5151

52-
- job: buster_armhf
52+
- job: bionic_armhf
5353
pool:
5454
vmImage: 'ubuntu-latest'
5555
steps:
5656
- template: build.yml
5757
parameters:
58-
arch: buster-armhf
58+
arch: bionic-armhf
5959

6060
- job: stretch_armhf
6161
pool:

bionic-arm64/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
2+
ARG TAG=18.04
3+
FROM ${REPO}:${TAG}
4+
5+
# ubuntu keeps its i386/amd64 and other architecture repos separate
6+
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
7+
# 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)
8+
RUN sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
9+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic main universe multiverse restricted" | tee -a /etc/apt/sources.list
10+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main universe multiverse restricted" | tee -a /etc/apt/sources.list
11+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
12+
RUN dpkg --add-architecture arm64
13+
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 \
15+
git \
16+
pkg-config \
17+
fakeroot \
18+
rpm \
19+
sudo \
20+
apt-transport-https \
21+
ca-certificates \
22+
libx11-dev:arm64 \
23+
libx11-xcb-dev:arm64 \
24+
libxkbfile-dev:arm64 \
25+
libsecret-1-dev:arm64 \
26+
curl \
27+
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
41+
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
47+
RUN python --version
48+
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+
54+
# Yarn
55+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
56+
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
57+
RUN apt-get update && apt-get install -y yarn
58+
59+
ENV AS=/usr/bin/aarch64-linux-gnu-as \
60+
AR=/usr/bin/aarch64-linux-gnu-ar \
61+
CC=/usr/bin/aarch64-linux-gnu-gcc-8 \
62+
CPP=/usr/bin/aarch64-linux-gnu-cpp-8 \
63+
CXX=/usr/bin/aarch64-linux-gnu-g++-8 \
64+
LD=/usr/bin/aarch64-linux-gnu-ld \
65+
FC=/usr/bin/aarch64-linux-gnu-gfortran-8 \
66+
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig

bionic-armhf/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
2+
ARG TAG=18.04
3+
FROM ${REPO}:${TAG}
4+
5+
# ubuntu keeps its i386/amd64 and other architecture repos separate
6+
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
7+
# 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)
8+
RUN sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
9+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic main universe multiverse restricted" | tee -a /etc/apt/sources.list
10+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main universe multiverse restricted" | tee -a /etc/apt/sources.list
11+
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
12+
RUN dpkg --add-architecture armhf
13+
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 \
15+
git \
16+
pkg-config \
17+
fakeroot \
18+
rpm \
19+
sudo \
20+
apt-transport-https \
21+
ca-certificates \
22+
libx11-dev:armhf \
23+
libx11-xcb-dev:armhf \
24+
libxkbfile-dev:armhf \
25+
libsecret-1-dev:armhf \
26+
curl \
27+
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
41+
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
47+
RUN python --version
48+
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+
54+
# Yarn
55+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
56+
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
57+
RUN apt-get update && apt-get install -y yarn
58+
59+
ENV AS=/usr/bin/arm-linux-gnueabihf-as \
60+
AR=/usr/bin/arm-linux-gnueabihf-ar \
61+
CC=/usr/bin/arm-linux-gnueabihf-gcc-8 \
62+
CPP=/usr/bin/arm-linux-gnueabihf-cpp-8 \
63+
CXX=/usr/bin/arm-linux-gnueabihf-g++-8 \
64+
LD=/usr/bin/arm-linux-gnueabihf-ld \
65+
FC=/usr/bin/arm-linux-gnueabihf-gfortran-8 \
66+
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig

0 commit comments

Comments
 (0)