Skip to content

Commit 961d980

Browse files
authored
Merge pull request #4639 from taocy001/arm64_buster_build
1. On the ARM architecture, python-j2cli is installed from source code, depends on python-setuptools and python-wheel. 2. On the ARM architecture, install python-cryptography from source code(from azure-storage==0.36.0) depends on libffi-dev and libssl-dev. 3. install crossbuild in buster slave for arm arch kernel compile. 4. Versions before 18.09 do not install docker-ce-cli. 5. umount /proc after dockerfs. 6. change image apt source list from stretch to buster for arm.
2 parents 3d0b65d + 4cd3617 commit 961d980

File tree

8 files changed

+42
-28
lines changed

8 files changed

+42
-28
lines changed

build_debian.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ sudo LANG=C chroot $FILESYSTEM_ROOT rm /tmp/docker.gpg
204204
sudo LANG=C chroot $FILESYSTEM_ROOT add-apt-repository \
205205
"deb [arch=$CONFIGURED_ARCH] https://download.docker.com/linux/debian $IMAGE_DISTRO stable"
206206
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
207-
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION}
207+
if dpkg --compare-versions ${DOCKER_VERSION} ge "18.09"; then
208+
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION}
209+
else
210+
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION}
211+
fi
212+
208213
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common gnupg2
209214

210215
if [ "$INSTALL_KUBERNETES" == "y" ]

dockers/docker-base-buster/Dockerfile.j2

+5-4
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ RUN apt-get update && \
6262
libpython2.7 \
6363
libdaemon0 \
6464
libdbus-1-3 \
65-
libjansson4
66-
65+
libjansson4 \
6766
# ip and ifconfig utility missing in docker for arm arch
68-
RUN apt-get -y install \
6967
iproute2 \
70-
net-tools
68+
net-tools \
69+
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
70+
python-setuptools \
71+
python-wheel
7172

7273
# For templating
7374
RUN pip install j2cli

dockers/docker-base-stretch/Dockerfile.j2

+5-4
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ RUN apt-get update && \
6060
libpython2.7 \
6161
libdaemon0 \
6262
libdbus-1-3 \
63-
libjansson4
64-
63+
libjansson4 \
6564
# ip and ifconfig utility missing in docker for arm arch
66-
RUN apt-get -y install \
6765
iproute2 \
68-
net-tools
66+
net-tools \
67+
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
68+
python-setuptools \
69+
python-wheel
6970

7071
# For templating
7172
RUN pip install j2cli

files/build_templates/sonic_debian_extension.j2

+3-1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable core_uploader.service
268268
sudo cp $IMAGE_CONFIGS/corefile_uploader/core_uploader.py $FILESYSTEM_ROOT/usr/bin/
269269
sudo cp $IMAGE_CONFIGS/corefile_uploader/core_analyzer.rc.json $FILESYSTEM_ROOT_ETC_SONIC/
270270
sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json
271+
272+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev
271273
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install azure-storage==0.36.0
272274
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install watchdog==0.10.2
273275
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install futures==3.3.0
@@ -461,14 +463,14 @@ echo "docker images pull complete"
461463

462464
sudo umount $FILESYSTEM_ROOT/target
463465
sudo rm -r $FILESYSTEM_ROOT/target
464-
sudo umount /proc || true
465466
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
466467
sudo umount $FILESYSTEM_ROOT/dockerfs
467468
sudo rm -fr $FILESYSTEM_ROOT/dockerfs
468469
sudo kill -9 `sudo $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS_PID` || true
469470
else
470471
sudo chroot $FILESYSTEM_ROOT service docker stop
471472
fi
473+
sudo umount /proc || true
472474
sudo rm $FILESYSTEM_ROOT/etc/init.d/docker
473475
{% for script in installer_start_scripts.split(' ') -%}
474476
sudo cp {{script}} $FILESYSTEM_ROOT/usr/bin/
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free
2-
deb-src [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free
3-
deb [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free
4-
deb-src [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free
5-
deb [arch=arm64] http://security.debian.org stretch/updates main contrib non-free
6-
deb-src [arch=arm64] http://security.debian.org stretch/updates main contrib non-free
7-
deb [arch=arm64] https://download.docker.com/linux/debian stretch stable
8-
deb [arch=arm64] http://ftp.debian.org/debian stretch-backports main
1+
deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
2+
deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
3+
deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
4+
deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
5+
deb [arch=arm64] http://security.debian.org buster/updates main contrib non-free
6+
deb-src [arch=arm64] http://security.debian.org buster/updates main contrib non-free
7+
deb [arch=arm64] https://download.docker.com/linux/debian buster stable
8+
deb [arch=arm64] http://ftp.debian.org/debian buster-backports main
99

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
deb [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free
2-
deb-src [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free
3-
deb [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free
4-
deb-src [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free
5-
deb [arch=armhf] http://security.debian.org stretch/updates main contrib non-free
6-
deb-src [arch=armhf] http://security.debian.org stretch/updates main contrib non-free
7-
deb [arch=armhf] https://download.docker.com/linux/debian stretch stable
8-
deb [arch=armhf] http://ftp.debian.org/debian stretch-backports main
1+
deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
2+
deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
3+
deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
4+
deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
5+
deb [arch=armhf] http://security.debian.org buster/updates main contrib non-free
6+
deb-src [arch=armhf] http://security.debian.org buster/updates main contrib non-free
7+
deb [arch=armhf] https://download.docker.com/linux/debian buster stable
8+
deb [arch=armhf] http://ftp.debian.org/debian buster-backports main
99

sonic-slave-buster/Dockerfile.j2

+6-1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold"
315315
# For linux build
316316
RUN apt-get -y build-dep linux
317317

318+
# For march kernel compile
319+
RUN apt-get install -y crossbuild-essential-amd64 \
320+
crossbuild-essential-arm64 \
321+
crossbuild-essential-armhf
322+
318323
# For gobgp and telemetry build
319324
RUN export VERSION=1.14.2 \
320325
{%- if CONFIGURED_ARCH == "armhf" %}
@@ -414,7 +419,7 @@ RUN apt-get update
414419
{%- if CONFIGURED_ARCH == "amd64" %}
415420
RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-buster docker-ce-cli=5:18.09.5~3-0~debian-buster
416421
{%- else %}
417-
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian docker-ce-cli=18.06.3~ce~3-0~debian
422+
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian
418423
{%- endif %}
419424
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker
420425
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy

sonic-slave-stretch/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,6 @@ RUN apt-get update
429429
{%- if CONFIGURED_ARCH == "amd64" %}
430430
RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-stretch docker-ce-cli=5:18.09.5~3-0~debian-stretch
431431
{%- else %}
432-
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian docker-ce-cli=18.06.3~ce~3-0~debian
432+
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian
433433
{%- endif %}
434434
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker

0 commit comments

Comments
 (0)