Skip to content

Commit

Permalink
[armhf][redis] compilation fixes for armhf arch (sonic-net#5901)
Browse files Browse the repository at this point in the history
1. Update SSL ca certificates for secure download [arm specific]
2. Using redis-tools from blob sonic-storage for docker-base-stretch

Signed-off-by: Sabareesh Kumar Anandan <[email protected]>
  • Loading branch information
Sabareesh-Kumar-Anandan authored and santhosh-kt committed Feb 25, 2021
1 parent e4cec02 commit e99c1d1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
11 changes: 5 additions & 6 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ set -x -e
CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64)

## docker engine version (with platform)
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
# Version name differs between ARCH, copying same version as in sonic-slave docker
DOCKER_VERSION=18.06.3~ce~3-0~debian
else
DOCKER_VERSION=5:18.09.8~3-0~debian-$IMAGE_DISTRO
fi
DOCKER_VERSION=5:18.09.8~3-0~debian-$IMAGE_DISTRO
LINUX_KERNEL_VERSION=4.19.0-9-2

## Working directory to prepare the file system
Expand Down Expand Up @@ -202,6 +197,10 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install apt-transport-https \
curl \
gnupg2 \
software-properties-common
if [[ $CONFIGURED_ARCH == armhf ]]; then
# update ssl ca certificates for secure pem
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT c_rehash
fi
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/docker.gpg -fsSL https://download.docker.com/linux/debian/gpg
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add /tmp/docker.gpg
sudo LANG=C chroot $FILESYSTEM_ROOT rm /tmp/docker.gpg
Expand Down
19 changes: 17 additions & 2 deletions dockers/docker-base-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]
# pre-install fundamental packages
RUN apt-get update && \
apt-get -y install \
curl \
less \
perl \
procps \
Expand All @@ -49,8 +50,6 @@ RUN apt-get update && \
# Install dependencies of supervisor
python-pkg-resources \
python-meld3 \
# Install redis-tools
redis-tools=5:5.0.3-3~bpo9+2 \
# common dependencies
libpython2.7 \
libdaemon0 \
Expand All @@ -70,6 +69,22 @@ RUN apt-get update && \
# Install a newer version of rsyslog from stretch-backports to support -iNONE
RUN apt-get -y -t stretch-backports install rsyslog

# Install redis-tools

{% if CONFIGURED_ARCH == "armhf" %}
RUN curl -o redis-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f -y
RUN rm redis-tools_6.0.6-1~bpo10+1_armhf.deb
{% elif CONFIGURED_ARCH == "arm64" %}
RUN curl -o redis-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f -y
RUN rm redis-tools_6.0.6-1~bpo10+1_arm64.deb
{% else %}
RUN curl -o redis-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -y
RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb
{% endif %}

# For templating
RUN pip install j2cli

Expand Down
3 changes: 3 additions & 0 deletions sonic-slave-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ RUN apt-get install -y \
curl \
gnupg2 \
software-properties-common
{%- if CONFIGURED_ARCH == "armhf" %}
RUN update-ca-certificates --fresh
{%- endif %}
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
RUN add-apt-repository \
"deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian \
Expand Down

0 comments on commit e99c1d1

Please sign in to comment.