[MERGED] osmo-ci[master]: docker: rebuild: if building fails, try a --no-cache build

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jan 15 13:26:55 UTC 2018


Neels Hofmeyr has submitted this change and it was merged.

Change subject: docker: rebuild: if building fails, try a --no-cache build
......................................................................


docker: rebuild: if building fails, try a --no-cache build

Building a docker image depending on a debian upstream has the problem that an
intermediate build result will depend on an APT package archive that is
probable to become outdated. It's necessary to do an 'apt-get update' regularly
to get the newest package archives and be able to install new packages. We
never know which 'apt-get install' steps we might be editing, so we'd have to
add an 'apt-get update' before each, or use an ADD line to find out whether the
package archive has changed, before each and every apt-get install step. We're
likely to miss those in the future, and it would be a large, complex change.

Instead, try to build the docker image with --no-cache in case a cached build
has failed. This should fetch the most recent debian upstream with a proper
archive.

Fixes the current problem that the rebuild_osmocom_jenkins_image.sh is stuck on
various build slaves, should trigger a --no-cache build on each slave.

Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3
---
M docker/rebuild_osmocom_jenkins_image.sh
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified



diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh
index 4b2d359..b49292a 100755
--- a/docker/rebuild_osmocom_jenkins_image.sh
+++ b/docker/rebuild_osmocom_jenkins_image.sh
@@ -1,2 +1,4 @@
 #!/bin/sh
-docker build -t osmocom:amd64 - < Dockerfile_osmocom_jenkins.amd64
+# In case the debian apt archive has become out of sync, try a --no-cache build if it fails.
+docker build -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . \
+ || docker build --no-cache -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 .

-- 
To view, visit https://gerrit.osmocom.org/5792
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list