Change in docker-playground[master]: osmo-*-master: Invalidate docker cache when CentOS repo changes

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Oct 16 12:54:04 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/20677 )

Change subject: osmo-*-master: Invalidate docker cache when CentOS repo changes
......................................................................

osmo-*-master: Invalidate docker cache when CentOS repo changes

We currently only invalidate the cache if the Debian repository changes,
but not if the CentOS repository changes.  This leads to strange
artefacts, such as CentOS containers for osmo-bts-master using an
old libosmocore, despite a new one being available in the repo.

As Dockerfiles don't support conditional "ADD", we need to actually
add both the CentOS and the Debian repsotiry file, so any change
in either of the two will now (unneccessarily) invalidate the cache
for both Debian and CentOS builds.

Change-Id: I7b13644afb9d3be3b94184193177e003c13718d3
---
M osmo-bsc-master/Dockerfile
M osmo-bts-master/Dockerfile
M osmo-ggsn-master/Dockerfile
M osmo-hlr-master/Dockerfile
M osmo-hnbgw-master/Dockerfile
M osmo-mgw-master/Dockerfile
M osmo-msc-master/Dockerfile
M osmo-nitb-master/Dockerfile
M osmo-pcu-master/Dockerfile
M osmo-remsim-master/Dockerfile
M osmo-sgsn-master/Dockerfile
M osmo-sip-master/Dockerfile
M osmo-smlc-master/Dockerfile
M osmo-stp-master/Dockerfile
14 files changed, 42 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved; Verified



diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile
index 6cfaebd..6c39831 100644
--- a/osmo-bsc-master/Dockerfile
+++ b/osmo-bsc-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile
index 6e208c6..df6ebb6 100644
--- a/osmo-bts-master/Dockerfile
+++ b/osmo-bts-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-ggsn-master/Dockerfile b/osmo-ggsn-master/Dockerfile
index 17ea3c9..a70a62e 100644
--- a/osmo-ggsn-master/Dockerfile
+++ b/osmo-ggsn-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-hlr-master/Dockerfile b/osmo-hlr-master/Dockerfile
index 1595c11..b6e572b 100644
--- a/osmo-hlr-master/Dockerfile
+++ b/osmo-hlr-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-hnbgw-master/Dockerfile b/osmo-hnbgw-master/Dockerfile
index 215b562..2e7b0b7 100644
--- a/osmo-hnbgw-master/Dockerfile
+++ b/osmo-hnbgw-master/Dockerfile
@@ -11,7 +11,10 @@
 	rm /tmp/Release.key && \
 	echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-nightly.list
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	apt-get update && \
 	apt-get install -y --no-install-recommends \
 		telnet \
diff --git a/osmo-mgw-master/Dockerfile b/osmo-mgw-master/Dockerfile
index c07697e..4097f56 100644
--- a/osmo-mgw-master/Dockerfile
+++ b/osmo-mgw-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-msc-master/Dockerfile b/osmo-msc-master/Dockerfile
index 15b59f0..c7e8508 100644
--- a/osmo-msc-master/Dockerfile
+++ b/osmo-msc-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-nitb-master/Dockerfile b/osmo-nitb-master/Dockerfile
index cd463fe..edb5434 100644
--- a/osmo-nitb-master/Dockerfile
+++ b/osmo-nitb-master/Dockerfile
@@ -11,7 +11,10 @@
 	rm /tmp/Release.key && \
 	echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-nightly.list
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	apt-get update && \
 	apt-get install -y --no-install-recommends \
 		telnet \
diff --git a/osmo-pcu-master/Dockerfile b/osmo-pcu-master/Dockerfile
index 8306837..af4426b 100644
--- a/osmo-pcu-master/Dockerfile
+++ b/osmo-pcu-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-remsim-master/Dockerfile b/osmo-remsim-master/Dockerfile
index 2653ac2..d50f624 100644
--- a/osmo-remsim-master/Dockerfile
+++ b/osmo-remsim-master/Dockerfile
@@ -43,7 +43,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-sgsn-master/Dockerfile b/osmo-sgsn-master/Dockerfile
index 58da791..c50b476 100644
--- a/osmo-sgsn-master/Dockerfile
+++ b/osmo-sgsn-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-sip-master/Dockerfile b/osmo-sip-master/Dockerfile
index 1f40ff0..e486979 100644
--- a/osmo-sip-master/Dockerfile
+++ b/osmo-sip-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-smlc-master/Dockerfile b/osmo-smlc-master/Dockerfile
index 94ab33d..b820cf6 100644
--- a/osmo-smlc-master/Dockerfile
+++ b/osmo-smlc-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \
diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile
index 26ec494..bc3e177 100644
--- a/osmo-stp-master/Dockerfile
+++ b/osmo-stp-master/Dockerfile
@@ -18,7 +18,10 @@
 		;; \
 	esac
 
+# we need to add this to invalidate the cache once the repository is updated.
+# unfortunately Dockerfiles don't support a conditional ARG, so we need to add both DPKG + RPM
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+ADD	http://download.opensuse.org/repositories/network:/osmocom:/nightly/CentOS_8_Stream/repodata/repomd.xml /tmp/repomd.xml
 RUN	case "$DISTRO" in \
 	debian*) \
 		apt-get update && \

-- 
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/20677
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I7b13644afb9d3be3b94184193177e003c13718d3
Gerrit-Change-Number: 20677
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201016/11a2e8e6/attachment.htm>


More information about the gerrit-log mailing list