Skip to content

Commit

Permalink
[Build] Support j2 template for debian sources for docker ptf (sonic-…
Browse files Browse the repository at this point in the history
…net#13198)

Change to use the sources.list from the file generated from the j2 template
  • Loading branch information
xumia committed Apr 17, 2023
1 parent 1aecce8 commit 21da1ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions dockers/docker-ptf/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,21 @@ 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(' ') -%}
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 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare_docker_buildinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 21da1ad

Please sign in to comment.