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
This commit is contained in:
Harald Welte 2020-10-16 11:10:08 +00:00 committed by Harald Welte
parent 687ea83fc6
commit 0cb56e4bc7
14 changed files with 42 additions and 0 deletions

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -11,7 +11,10 @@ RUN apt-key add /tmp/Release.key && \
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 \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -11,7 +11,10 @@ RUN apt-key add /tmp/Release.key && \
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 \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -43,7 +43,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \

View File

@ -18,7 +18,10 @@ RUN case "$DISTRO" in \
;; \
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 && \