From ef76e82e404cf796aef3fe7877794de8ee06535c Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:31:36 +0800 Subject: [PATCH] [Build][201811] Fix the jessie mirror removed issue (#14526) * [Build][201811] Fix the jessie mirror removed issue * Fix build break for jessie apt key expiration. (#13328) The GPG key used for Jessie's official repos has since expired, which means building 201911 images no longer works. Fake the time to be before the expiry date. * [build] Fix issues caused by docker.com gpg key update. (#14063) Why I did it docker.com's gpg key start to work from 2023-02-23. While debian.org's gpg key expired in 2022-11. We used a walkaround for security checking for debian gpg keys. Now we need to exclude docker.com's gpg key. How I did it Update docker.com's gpg key without faketime. Update others' gpg key with faketime '2022-11' How to verify it * Fix build break for jessie apt key expiration --------- Co-authored-by: Saikrishna Arcot Co-authored-by: Liu Shilong --- Makefile.work | 8 ++++++ dockers/docker-base/Dockerfile.j2 | 7 ++++- dockers/docker-base/sources.list | 8 +++--- dockers/docker-basic_router/Dockerfile | 2 +- dockers/docker-config-engine/Dockerfile.j2 | 2 +- dockers/docker-database/Dockerfile.j2 | 2 +- dockers/docker-dhcp-relay/Dockerfile.j2 | 2 +- dockers/docker-fpm-frr/Dockerfile.j2 | 2 +- dockers/docker-fpm-gobgp/Dockerfile.j2 | 2 +- dockers/docker-fpm-quagga/Dockerfile.j2 | 2 +- dockers/docker-lldp-sv2/Dockerfile.j2 | 2 +- dockers/docker-orchagent/Dockerfile.j2 | 2 +- dockers/docker-platform-monitor/Dockerfile.j2 | 2 +- dockers/docker-ptf/Dockerfile.j2 | 9 ++++--- dockers/docker-ptf/sources.list | 1 + .../docker-router-advertiser/Dockerfile.j2 | 2 +- dockers/docker-snmp-sv2/Dockerfile.j2 | 2 +- dockers/docker-sonic-telemetry/Dockerfile.j2 | 2 +- dockers/docker-teamd/Dockerfile.j2 | 2 +- .../barefoot/docker-saiserver-bfn/Dockerfile | 2 +- .../docker-syncd-bfn-rpc/Dockerfile.j2 | 2 +- .../barefoot/docker-syncd-bfn/Dockerfile.j2 | 2 +- .../docker-saiserver-brcm/Dockerfile.j2 | 2 +- .../docker-syncd-brcm-rpc/Dockerfile.j2 | 2 +- .../broadcom/docker-syncd-brcm/Dockerfile.j2 | 2 +- .../innovium/docker-syncd-invm/Dockerfile.j2 | 2 +- .../marvell/docker-syncd-mrvl/Dockerfile.j2 | 2 +- .../docker-saiserver-mlnx/Dockerfile.j2 | 2 +- .../docker-syncd-mlnx-rpc/Dockerfile.j2 | 2 +- .../mellanox/docker-syncd-mlnx/Dockerfile.j2 | 2 +- platform/vs/docker-sonic-vs/Dockerfile.j2 | 7 +++-- platform/vs/docker-syncd-vs/Dockerfile.j2 | 2 +- sonic-slave/Dockerfile | 26 +++++++++++-------- 33 files changed, 71 insertions(+), 47 deletions(-) create mode 120000 dockers/docker-ptf/sources.list diff --git a/Makefile.work b/Makefile.work index 5a8f9e991148..7827bea76653 100644 --- a/Makefile.work +++ b/Makefile.work @@ -127,9 +127,17 @@ SONIC_BUILD_INSTRUCTION := make \ .PHONY: sonic-slave-build sonic-slave-bash init reset .DEFAULT_GOAL := all +FAKETIME := rm -rf faketime_0.9.7-2_amd64.deb libfaketime_0.9.7-2_amd64.deb; \ + curl "https://sonicstoragepublic.blob.core.windows.net/packages/libfaketime_0.9.7-2_amd64.deb?sp=r&st=2022-12-05T06:39:44Z&se=2032-12-05T14:39:44Z&spr=https&sv=2021-06-08&sr=b&sig=SDqUC7DtESpNHTc1Dsh%2B9%2Finxfo4OwNiXGw762OV2tM%3D" -o libfaketime_0.9.7-2_amd64.deb; \ + curl "https://sonicstoragepublic.blob.core.windows.net/packages/faketime_0.9.7-2_amd64.deb?sp=r&st=2022-12-05T04:50:15Z&se=2033-12-06T12:50:15Z&spr=https&sv=2021-06-08&sr=b&sig=7l4dm4tyO73RwwAbRM6zNEglkOjs8bLV%2BJe9coiEHxo%3D" -o faketime_0.9.7-2_amd64.deb; \ + cp faketime_0.9.7-2_amd64.deb libfaketime_0.9.7-2_amd64.deb dockers/docker-base/; \ + cp faketime_0.9.7-2_amd64.deb libfaketime_0.9.7-2_amd64.deb sonic-slave/; \ + cp faketime_0.9.7-2_amd64.deb libfaketime_0.9.7-2_amd64.deb dockers/docker-ptf/ %:: @$(OVERLAY_MODULE_CHECK) + @$(FAKETIME) + @docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \ { echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \ $(DOCKER_BASE_BUILD) ; } diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 68a3176ab6ee..5d2b07d5af85 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -24,7 +24,12 @@ ENV DEBIAN_FRONTEND=noninteractive COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] COPY ["sources.list", "/etc/apt/sources.list"] COPY ["no-check-valid-until", "no-install-recommend-suggest", "/etc/apt/apt.conf.d/"] -RUN apt-get update + +COPY ["faketime_0.9.7-2_amd64.deb", "/root"] +COPY ["libfaketime_0.9.7-2_amd64.deb","/root"] +RUN dpkg -i /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb +RUN rm /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb +RUN faketime "2022-11-01" apt-get update # Pre-install fundamental packages RUN apt-get -y install \ diff --git a/dockers/docker-base/sources.list b/dockers/docker-base/sources.list index 45a508420a89..ede503cdc286 100644 --- a/dockers/docker-base/sources.list +++ b/dockers/docker-base/sources.list @@ -1,8 +1,8 @@ ## Debian mirror on Microsoft Azure ## Ref: http://debian-archive.trafficmanager.net/ -deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free -deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free -deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free -deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free +deb http://packages.trafficmanager.net/snapshot/debian/20230101T000234Z/ jessie main contrib non-free +deb-src http://packages.trafficmanager.net/snapshot/debian/20230101T000234Z/ jessie main contrib non-free +deb http://packages.trafficmanager.net/snapshot/debian-security/20230101T000243Z/ jessie/updates main contrib non-free +deb-src http://packages.trafficmanager.net/snapshot/debian-security/20230101T000243Z/ jessie/updates main contrib non-free deb http://archive.debian.org/debian/ jessie-backports main contrib non-free diff --git a/dockers/docker-basic_router/Dockerfile b/dockers/docker-basic_router/Dockerfile index 7d7c724920c2..b7b449711592 100644 --- a/dockers/docker-basic_router/Dockerfile +++ b/dockers/docker-basic_router/Dockerfile @@ -6,7 +6,7 @@ MAINTAINER Xudong Wu ENV DEBIAN_FRONTEND=noninteractive ## Update apt's cache of available packages -RUN apt-get clean && apt-get update +RUN apt-get clean && faketime "2022-11-01" apt-get update COPY deps /deps diff --git a/dockers/docker-config-engine/Dockerfile.j2 b/dockers/docker-config-engine/Dockerfile.j2 index 8dca69e567b8..02126265a568 100644 --- a/dockers/docker-config-engine/Dockerfile.j2 +++ b/dockers/docker-config-engine/Dockerfile.j2 @@ -3,7 +3,7 @@ FROM docker-base ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Dependencies for sonic-cfggen RUN apt-get install -y python-lxml python-yaml python-bitarray python-pip python-dev python-natsort diff --git a/dockers/docker-database/Dockerfile.j2 b/dockers/docker-database/Dockerfile.j2 index 697b4309fe7d..6a13dfaf2705 100644 --- a/dockers/docker-database/Dockerfile.j2 +++ b/dockers/docker-database/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update {% if docker_database_debs.strip() -%} # Copy locally-built Debian package dependencies diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index d6c55bb2028b..f9e2afa93808 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update {% if docker_dhcp_relay_debs.strip() -%} # Copy built Debian packages diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index 6f046af6cf27..de9bd3653cc7 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -10,7 +10,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Install required packages RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 libc-ares2 iproute libpython2.7 diff --git a/dockers/docker-fpm-gobgp/Dockerfile.j2 b/dockers/docker-fpm-gobgp/Dockerfile.j2 index 1e333d9026c0..5370cf781417 100644 --- a/dockers/docker-fpm-gobgp/Dockerfile.j2 +++ b/dockers/docker-fpm-gobgp/Dockerfile.j2 @@ -3,7 +3,7 @@ FROM docker-fpm-quagga ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_fpm_gobgp_debs.split(' ') -%} diff --git a/dockers/docker-fpm-quagga/Dockerfile.j2 b/dockers/docker-fpm-quagga/Dockerfile.j2 index f048e2789429..c470dfba9ad4 100644 --- a/dockers/docker-fpm-quagga/Dockerfile.j2 +++ b/dockers/docker-fpm-quagga/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Install required packages RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7 diff --git a/dockers/docker-lldp-sv2/Dockerfile.j2 b/dockers/docker-lldp-sv2/Dockerfile.j2 index ec5de2a25a31..a05dd2d26163 100644 --- a/dockers/docker-lldp-sv2/Dockerfile.j2 +++ b/dockers/docker-lldp-sv2/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Install dependencies RUN apt-get install -y python-pip libbsd0 libevent-2.0-5 libjansson4 libwrap0 libxml2 libpci3 libperl5.20 libpython2.7 diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 63d5288b318e..c09efab9dd12 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4 libpython2.7 pciutils diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 6a15f6e08e9a..7d682e879b71 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Install required packages RUN apt-get install -y python-pip libpython2.7 sensord fancontrol ipmitool diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 7512627e9923..29bc39d4bb6a 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -2,8 +2,12 @@ FROM debian:jessie 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 ["sources.list", "/etc/apt/sources.list"] +COPY ["faketime_0.9.7-2_amd64.deb", "/root"] +COPY ["libfaketime_0.9.7-2_amd64.deb","/root"] +RUN dpkg -i /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb +RUN rm /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb +RUN faketime "2022-11-01" apt-get update ## Copy dependencies COPY \ @@ -17,7 +21,6 @@ ENV DEBIAN_FRONTEND=noninteractive ## Set the apt source, update package cache and install necessary packages RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \ - && apt-get update \ && apt-get upgrade -y \ && apt-get dist-upgrade -y \ && apt-get install -y \ diff --git a/dockers/docker-ptf/sources.list b/dockers/docker-ptf/sources.list new file mode 120000 index 000000000000..59c05c688da3 --- /dev/null +++ b/dockers/docker-ptf/sources.list @@ -0,0 +1 @@ +../docker-base/sources.list \ No newline at end of file diff --git a/dockers/docker-router-advertiser/Dockerfile.j2 b/dockers/docker-router-advertiser/Dockerfile.j2 index d314a3f262d6..485f0a045874 100644 --- a/dockers/docker-router-advertiser/Dockerfile.j2 +++ b/dockers/docker-router-advertiser/Dockerfile.j2 @@ -7,7 +7,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update {% if docker_router_advertiser_debs.strip() -%} # Copy built Debian packages diff --git a/dockers/docker-snmp-sv2/Dockerfile.j2 b/dockers/docker-snmp-sv2/Dockerfile.j2 index d9ce4beb710b..47a6ac2b1f5a 100644 --- a/dockers/docker-snmp-sv2/Dockerfile.j2 +++ b/dockers/docker-snmp-sv2/Dockerfile.j2 @@ -10,7 +10,7 @@ ENV PYTHONOPTIMIZE 1 ENV DEBIAN_FRONTEND=noninteractive # Update apt's cache of available packages -RUN apt-get update +RUN faketime "2022-11-01" apt-get update # Install curl so we can download and install pip later # Also install major root CA certificates for curl to reference diff --git a/dockers/docker-sonic-telemetry/Dockerfile.j2 b/dockers/docker-sonic-telemetry/Dockerfile.j2 index 90fc13f28c6a..a359d7956966 100644 --- a/dockers/docker-sonic-telemetry/Dockerfile.j2 +++ b/dockers/docker-sonic-telemetry/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 diff --git a/dockers/docker-teamd/Dockerfile.j2 b/dockers/docker-teamd/Dockerfile.j2 index 458c0ef3d021..81be6167c293 100644 --- a/dockers/docker-teamd/Dockerfile.j2 +++ b/dockers/docker-teamd/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7 diff --git a/platform/barefoot/docker-saiserver-bfn/Dockerfile b/platform/barefoot/docker-saiserver-bfn/Dockerfile index 427a551e0096..e1c7e819a5ab 100755 --- a/platform/barefoot/docker-saiserver-bfn/Dockerfile +++ b/platform/barefoot/docker-saiserver-bfn/Dockerfile @@ -3,7 +3,7 @@ FROM docker-base ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY ["deps/applibs_*.deb", "/deps/applibs-dev_*.deb", "/deps/sx-complib_*.deb", "/deps/sxd-libs_*.deb", "/deps/sx-scew_*.deb", "/deps/sx-examples_*.deb", "/deps/sx-gen-utils_*.deb", "/deps/python-sdk-api_*.deb", "/deps/iproute2_*.deb", "/deps/mlnx-sai_*.deb", "/deps/libthrift-0.9.3_*.deb", "/deps/libnl-3-200_*.deb", "/deps/libnl-genl-3-200_*.deb", "/deps/libnl-route-3-200_*.deb", "/deps/"] diff --git a/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 index 68604d92f6b5..b6ac5fa826db 100644 --- a/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 @@ -17,7 +17,7 @@ dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} ## Pre-install the fundamental packages -RUN apt-get update \ +RUN faketime "2022-11-01" apt-get update \ && apt-get -y install \ net-tools \ python-pip \ diff --git a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 index 25c7872f6460..feb6744948ce 100755 --- a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 @@ -3,7 +3,7 @@ FROM docker-config-engine ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_bfn_debs.split(' ') -%} diff --git a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 index 7961aa98fb4e..d6c72767f705 100644 --- a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 +++ b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_saiserver_brcm_debs.split(' ') -%} diff --git a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 index c8f0590023ed..845e77c30768 100644 --- a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 +++ b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 @@ -17,7 +17,7 @@ dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} ## Pre-install the fundamental packages -RUN apt-get update \ +RUN faketime "2022-11-01" apt-get update \ && apt-get -y install \ net-tools \ python-pip \ diff --git a/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 b/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 index 78c296d96d92..24ab2b57a1a8 100755 --- a/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 +++ b/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_brcm_debs.split(' ') -%} diff --git a/platform/innovium/docker-syncd-invm/Dockerfile.j2 b/platform/innovium/docker-syncd-invm/Dockerfile.j2 index d38258576dd3..12b7545b1bf0 100755 --- a/platform/innovium/docker-syncd-invm/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm/Dockerfile.j2 @@ -3,7 +3,7 @@ FROM docker-config-engine ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_invm_debs.split(' ') -%} diff --git a/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 b/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 index ca48db80879e..43b272db4006 100755 --- a/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 +++ b/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_mrvl_debs.split(' ') -%} diff --git a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 index 0ada859e6450..58b1eee9ea6a 100644 --- a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_saiserver_mlnx_debs.split(' ') -%} diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index 0a2010dcbbc1..84317adb73d4 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -17,7 +17,7 @@ dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} ## Pre-install the fundamental packages -RUN apt-get update \ +RUN faketime "2022-11-01" apt-get update \ && apt-get -y install \ net-tools \ python-pip \ diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index 971602a212f0..6ebaf37bd393 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_mlnx_debs.split(' ') -%} diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 0d2daf93fce1..dfc083161159 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive COPY ["sonic-dev.gpg.key", "/etc/apt/"] RUN apt-key add /etc/apt/sonic-dev.gpg.key RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list -RUN apt-get update +RUN faketime "2022-11-01" apt-get update RUN apt-get install -y net-tools \ arping \ @@ -36,7 +36,6 @@ RUN apt-get install -y net-tools \ iproute \ libpython2.7 \ grub2-common \ - python-click-default-group \ python-click \ python-natsort \ python-tabulate \ @@ -55,6 +54,10 @@ RUN pip install six RUN pip install pyroute2==0.5.3 netifaces==0.10.7 RUN pip install monotonic==1.5 +# Fix the python-click-default-group not found issue +RUN pip install --upgrade 'pip<21' +RUN pip install click-default-group + {% if docker_sonic_vs_debs.strip() -%} # Copy locally-built Debian package dependencies {%- for deb in docker_sonic_vs_debs.split(' ') %} diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 index 7bef89fe57b5..6e46a14ec615 100644 --- a/platform/vs/docker-syncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -6,7 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +RUN faketime "2022-11-01" apt-get update COPY \ {% for deb in docker_syncd_vs_debs.split(' ') -%} diff --git a/sonic-slave/Dockerfile b/sonic-slave/Dockerfile index d98099e80e10..7b4df2048306 100644 --- a/sonic-slave/Dockerfile +++ b/sonic-slave/Dockerfile @@ -7,15 +7,20 @@ COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] ## Remove retired jessie-updates repo RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -RUN echo "deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list +RUN echo "deb http://packages.trafficmanager.net/snapshot/debian/20230101T000234Z/ jessie main contrib non-free" > /etc/apt/sources.list && \ + echo "deb-src http://packages.trafficmanager.net/snapshot/debian/20230101T000234Z/ jessie main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb http://packages.trafficmanager.net/snapshot/debian-security/20230101T000243Z/ jessie/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://packages.trafficmanager.net/snapshot/debian-security/20230101T000243Z/ jessie/updates main contrib non-free" >> /etc/apt/sources.list ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y \ +COPY ["faketime_0.9.7-2_amd64.deb","/root"] +COPY ["libfaketime_0.9.7-2_amd64.deb","/root"] +RUN dpkg -i /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb +RUN rm /root/faketime_0.9.7-2_amd64.deb /root/libfaketime_0.9.7-2_amd64.deb + +RUN faketime "2022-11-01" apt-get update && apt-get install -y \ apt-utils \ default-jre-headless \ openssh-server \ @@ -319,7 +324,7 @@ RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git / ENV PATH /usr/share/depot_tools:$PATH # Install docker engine 17.03.2~ce-0 inside docker and enable experimental feature -RUN apt-get update +RUN faketime "2022-11-01" apt-get update RUN apt-get install -y \ apt-transport-https \ ca-certificates \ @@ -327,12 +332,11 @@ RUN apt-get install -y \ gnupg2 \ software-properties-common RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - -RUN add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/debian \ - $(lsb_release -cs) \ - stable" -RUN apt-get update +RUN echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" >> /etc/apt/sources.list.d/docker.list + +RUN apt-get update -o Dir::Etc::sourcelist="sources.list.d/docker.list" RUN apt-get install -y docker-ce=17.03.2~ce-0~debian-jessie +RUN rm /etc/apt/sources.list.d/docker.list RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker # Remove the stale cert and refresh the certs