From 37227fd187018a616ab8a374993e8564b1f791da Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 8 May 2019 20:03:22 +0100
Subject: [PATCH] ci: Use a temporary Docker image so that we can update apt
 lists first

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 ci/Dockerfile.in | 3 +++
 ci/Jenkinsfile   | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 ci/Dockerfile.in

diff --git a/ci/Dockerfile.in b/ci/Dockerfile.in
new file mode 100644
index 000000000..440ad72e6
--- /dev/null
+++ b/ci/Dockerfile.in
@@ -0,0 +1,3 @@
+FROM @BASE_IMAGE@
+RUN apt-get update
+# vim:set sw=4 sts=4 et ft=dockerfile:
diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile
index 7cef91e70..ef1f36684 100644
--- a/ci/Jenkinsfile
+++ b/ci/Jenkinsfile
@@ -66,8 +66,12 @@ pipeline {
             env.CI_DOCKER_OPTIONS = ''
           }
 
+          sh """
+          sed -e 's!@BASE_IMAGE@!${env.CI_DOCKER_REGISTRY}/${env.CI_DOCKER_IMAGE}!g' < src/ci/Dockerfile.in > src/ci/Dockerfile
+          """
+
           docker.withRegistry("https://${env.CI_DOCKER_REGISTRY}", dockerRegistryCred) {
-            docker.image("${env.CI_DOCKER_REGISTRY}/${env.CI_DOCKER_IMAGE}").inside("--mount type=tmpfs,destination=/var/cache/apt/archives ${env.CI_DOCKER_OPTIONS}") {
+            docker.build("${env.CI_DOCKER_REGISTRY}/pressure-vessel", '-f src/ci/Dockerfile').inside("--mount type=tmpfs,destination=/var/cache/apt/archives ${env.CI_DOCKER_OPTIONS}") {
               sh '''
               set -eu
               cd src
-- 
GitLab