Skip to content

Commit

Permalink
Make sure new binaries replace existing binaries in docker-sonic-vs
Browse files Browse the repository at this point in the history
PR #716 removed a step where existing deb packages were removed before
installing the new deb packages. The problem is that due to Docker's
change detection code, where it only checks the file size and the
modification timestamp, even if the file gets modified when installing a
newer debian package, the file size may remain the same, and the
modification timestamp will remain the same (since this is based on the
debian/changelog timestamp). This caused changed binaries to not
actually replace the existing binaries.

Fix this by re-adding the line that removed existing packages first.

Signed-off-by: Saikrishna Arcot <[email protected]>
  • Loading branch information
saiarcot895 committed Jul 28, 2023
1 parent 62e8d80 commit 905a021
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .azure-pipelines/docker-sonic-vs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ ARG docker_container_name

COPY ["debs", "/debs"]

# Remove existing packages first before installing the new/current packages. This is to overcome limitations with
# Docker's diff detection mechanism, where only the file size and the modification timestamp (which will remain the
# same, even though contents have changed) are checked between the previous and current layer.
RUN dpkg --purge libswsscommon python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss
RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb /debs/python3-swsscommon_1.0.0_amd64.deb /debs/sonic-db-cli_1.0.0_amd64.deb /debs/libsaimetadata_1.0.0_amd64.deb /debs/libsairedis_1.0.0_amd64.deb /debs/libsaivs_1.0.0_amd64.deb /debs/syncd-vs_1.0.0_amd64.deb /debs/swss_1.0.0_amd64.deb

0 comments on commit 905a021

Please sign in to comment.