osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/38769?usp=email )

Change subject: jenkins-common: add NO_DOCKER_IMAGE_PULL
......................................................................

jenkins-common: add NO_DOCKER_IMAGE_PULL

The docker_images_require function runs "docker build" with the "--pull"
argument to automatically get new base images (typically debian
bookworm).

Recently this started to cause an error when building the arm32/v7
image debian-bookworm-build-arm on the now arm64/v8 (aarch64) rpi4.

Add NO_DOCKER_IMAGE_PULL to be able to omit "--pull". The related patch
adjusts osmo-ci to pull separately beforehand.

Related: OS#6627
Related: osmo-ci Ibf91bc098f34b43f46680d0395928e60cdd478fc
Change-Id: I6e0a84ce7f8357611abc5da856f36d0df247de75
---
M README.md
M jenkins-common.sh
2 files changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved




diff --git a/README.md b/README.md
index 3139f07..314c91e 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,7 @@
   Osmocom project. Defaults to `master`.
 * `NO_DOCKER_IMAGE_BUILD`: when set to `1`, it won't try to update the
   containers (see "caching" below)
+* `NO_DOCKER_IMAGE_PULL`: when running `docker build`, don't add `--pull`
 * `DOCKER_ARGS`: pass extra arguments to docker, e.g. to mount local sources
   for building as done in osmo-dev.git/ttcn3/ttcn3.sh
 * `TEST_CONFIGS`: for tests that can run with multiple config sets (e.g.
diff --git a/jenkins-common.sh b/jenkins-common.sh
index af52b7f..acdf262 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -203,10 +203,12 @@
                        dir="$(docker_dir_from_image_name "$i")"

                        # Pull upstream base images
-                       pull_arg="--pull"
-                       from_line="$(grep '^FROM' 
${IMAGE_DIR_PREFIX}/${dir}/Dockerfile)"
-                       if echo "$from_line" | grep -q '$USER'; then
-                               pull_arg=""
+                       if [ -z "$NO_DOCKER_IMAGE_PULL" ]; then
+                               pull_arg="--pull"
+                               from_line="$(grep '^FROM' 
${IMAGE_DIR_PREFIX}/${dir}/Dockerfile)"
+                               if echo "$from_line" | grep -q '$USER'; then
+                                       pull_arg=""
+                               fi
                        fi

                        set +x

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

Gerrit-MessageType: merged
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I6e0a84ce7f8357611abc5da856f36d0df247de75
Gerrit-Change-Number: 38769
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to