diff options
author | Your Name <you@example.com> | 2018-01-15 14:09:17 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-01-15 14:10:21 +0100 |
commit | 3eca350f60ab5a395fd5190f0dee3a5801904a9c (patch) | |
tree | 5720b83c98c9be8a102b98f43becb748aec87d00 | |
parent | 1ad873d4d50b5e8c3428711319cbe05938720f4a (diff) |
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
-rwxr-xr-x | docker/rebuild_osmocom_jenkins_image.sh | 4 |
1 files changed, 3 insertions, 1 deletions
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 . |