Skip to content

Commit

Permalink
Merge pull request #230 from mahdipub/issue_9128_2
Browse files Browse the repository at this point in the history
issue_9128 solves issue working with non-default docker registries
  • Loading branch information
AdamBrousseau authored Jun 20, 2024
2 parents c4ad77c + 810d2b3 commit a475be5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,9 @@ class Build {
}
}
// Store the pulled docker image digest as 'buildinfo'
dockerImageDigest = context.sh(script: "docker inspect --format='{{.RepoDigests}}' ${buildConfig.DOCKER_IMAGE}", returnStdout:true)
def long_docker_image_name = context.sh(script: "docker image ls | grep ${buildConfig.DOCKER_IMAGE} | head -n1 | awk '{print \$1}'", returnStdout:true).trim()
context.sh(script: "docker tag '${long_docker_image_name}' '${buildConfig.DOCKER_IMAGE}'", returnStdout:false)
dockerImageDigest = context.sh(script: "docker inspect --format='{{index .RepoDigests 0}}' ${long_docker_image_name}", returnStdout:true)

// Use our dockerfile if DOCKER_FILE is defined
if (buildConfig.DOCKER_FILE) {
Expand Down Expand Up @@ -2495,7 +2497,6 @@ class Build {
}
}
} else {
dockerImageDigest = dockerImageDigest.replaceAll("\\[", "").replaceAll("\\]", "")
String dockerRunArg="-e \"BUILDIMAGESHA=$dockerImageDigest\""

// Are we running podman in Docker CLI Emulation mode?
Expand Down

0 comments on commit a475be5

Please sign in to comment.