gradle-docker-plugin
gradle-docker-plugin copied to clipboard
DockerBuild task fails when it needs to pull from multiple private registries
Expected Behavior
It should pull the image from ironbank
Current Behavior
Unable to authorize against ironbank harbor
Context
Trying to pull a private docker image from ironbank harbor but unable to do so
Steps to Reproduce (for bugs)
I am running into an issue to pull an image from harbour & defining the following does nothing for me.
docker {
registryCredentials {
url = ironbankDockerRegistryUrl
username = ironbankDockerRegistryUsername
password = ironbankRegistryPassword
email = ironbankDockerRegistryEmail
}
}
The task below is where I want to use the said registry credentials
task ubidockerBuildImage(type: DockerBuildImage) {
description = 'Builds an image using the Docker daemon for the current build.'
dependsOn UBIsyncDockerBuildContext
inputDir = file(dockerBuildContextDir)
dockerFile = file("${dockerBuildContextDir}/UBI/Dockerfile")
buildArgs = ['DPM_VERSION': version, 'BUILD_NUMBER': buildNumber == null ? '1' : buildNumber, 'GIT_REVISION' : "${revision}"]
images = ["${dockerImageName}:${version}-ubi"]
}
A similar issue where it was closed with a solution #545
Your Environment
plugin version used 6.1.3
Jenkinsfile calling a gradle build and yes all the variables are being passed by jenkins
We have a functional test for Harbor specifically. I just ran it and it works fine for me. You may want to have a look at it.
What error do you see? We'd need to see the output from the failed task.
I got it to work, I just to make sure the correct context was being picked up. Thanks
From the looks of it, I need to log in to multiple registries to pull images for multi-staged build & when I login into the second one I am unable to pull the image from the 1st store
Can you provide a sample project so I have a better idea of how this looks like?
Closing as I haven't heard back from you. Let me know if you need further assistance.