From d1a0780c7a7727048494c7dfa4b5047b04f8a890 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Thu, 30 Jul 2020 08:30:26 +1000 Subject: [PATCH] Attempt to circumvent docker login token timeouts --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80a0d21f..8713f13c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -136,9 +136,12 @@ pipeline { } steps { withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { + // Buildx to local cache + sh "./scripts/buildx --cache-to=type=local,dest=cache,mode=max -t ${IMAGE}:build-${BRANCH_LOWER}-${BUILD_NUMBER}" + // Docker Login sh "docker login -u '${duser}' -p '${dpass}'" - // Buildx with push - sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}" + // Buildx with push from cache + sh "./scripts/buildx --push --cache-from=type=local,src=cache ${BUILDX_PUSH_TAGS}" } } }