Is it possible to set private docker registry for entire team?

8 views
Skip to first unread message

ape...@shoprunner.com

unread,
Aug 16, 2018, 11:10:36 PM8/16/18
to Jenkins Users
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()

Reply all
Reply to author
Forward
0 new messages