We use Jenkins scripted pipelines to build & push docker images...
imageName = "someimage"
currImage = docker.build("${PRIVATE_REGISTRY}/${imageName}")
docker.withRegistry("https://${PRIVATE_REGISTRY}", 'registry_cred_id') {
currImage.push()
}
Is it possible to set something globally for the
docker function so we can keep our pipeline files more DRY and not have to repeat some of that?
If the docker command knows where I want to push and know which credentials I use it would be awesome
Hoping to end up with something like the following...
imageName = "someimage"
currImage = docker.build("${PRIVATE_REGISTRY}/${imageName}")
currImage.push()