From 22ce0232de3514582e37b3ab4a1f60d7ef444e04 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:33:21 +0800 Subject: [PATCH] [Build] Support j2 template for debian sources for docker ptf (#13198) Change to use the sources.list from the file generated from the j2 template --- dockers/docker-ptf/Dockerfile.j2 | 8 +++----- scripts/prepare_docker_buildinfo.sh | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index a46210c522a8..873cc9428a9a 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -9,9 +9,6 @@ FROM {{ prefix }}debian:stretch MAINTAINER Pavel Shirshov -## Remove retired jessie-updates repo -RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list - ## Copy dependencies COPY \ {% for deb in docker_ptf_debs.split(' ') -%} @@ -19,13 +16,14 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] + ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive ## Set the apt source, update package cache and install necessary packages ## TODO: Clean up this step -RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \ - && apt-get update \ +RUN apt-get update \ && apt-get upgrade -y \ && apt-get dist-upgrade -y \ && apt-get install -y \ diff --git a/scripts/prepare_docker_buildinfo.sh b/scripts/prepare_docker_buildinfo.sh index 3c1104eddc53..c5547dfc3094 100755 --- a/scripts/prepare_docker_buildinfo.sh +++ b/scripts/prepare_docker_buildinfo.sh @@ -22,7 +22,7 @@ if [ -z "$DISTRO" ]; then [ -z "$DISTRO" ] && DISTRO=jessie fi -if [[ "$IMAGENAME" == docker-base-* ]]; then +if [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then scripts/build_mirror_config.sh ${DOCKERFILE_PATH} $ARCH $DISTRO fi