Skip to content

Commit 38c5d7f

Browse files
authored
[Build] Support j2 template for debian sources for docker ptf (sonic-net#13198)
Change to use the sources.list from the file generated from the j2 template
1 parent 86a5a7f commit 38c5d7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dockers/docker-ptf/Dockerfile.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ WORKDIR /root
1414

1515
MAINTAINER Pavel Shirshov
1616

17-
RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list
17+
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
18+
1819
## Make apt-get non-interactive
1920
ENV DEBIAN_FRONTEND=noninteractive
2021

2122
## Set the apt source, update package cache and install necessary packages
2223
## TODO: Clean up this step
23-
RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \
24-
&& apt-get update \
24+
RUN apt-get update \
2525
&& apt-get upgrade -y \
2626
&& apt-get dist-upgrade -y \
2727
&& apt-get install -y \

scripts/prepare_docker_buildinfo.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [ -z "$DISTRO" ]; then
3838
fi
3939
fi
4040

41-
if [[ "$IMAGENAME" == docker-base-* ]]; then
41+
if [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then
4242
scripts/build_mirror_config.sh ${DOCKERFILE_PATH} $ARCH $DISTRO
4343
fi
4444

0 commit comments

Comments
 (0)