Skip to content

Instantly share code, notes, and snippets.

@iocanel
Created February 23, 2016 08:35
Show Gist options
  • Save iocanel/f68f0f1971ef8a610fa7 to your computer and use it in GitHub Desktop.
Save iocanel/f68f0f1971ef8a610fa7 to your computer and use it in GitHub Desktop.
Pushing a single image to multiple registries
node {
//Using the DSL syntax
kubernetes.image().withName("example").build().fromPath(".")
kubernetes.image().withName("example").tag().inRepository('default/example').withTag("1.0")
kubernetes.image().withName("default/example").push().withTag("1.0").toRegistry("172.30.101.121:5000")
kubernetes.image().withName("default/example").push().withTag("1.0").toRegistry("172.30.101.122:5000")
kubernetes.image().withName("default/example").push().withTag("1.0").toRegistry("172.30.101.123:5000")
}
node {
//Using the functions with named parameters
buildImage(name: 'example', path: '.')
tagImage(name: 'example', repo: 'default/example', tag: '1.0')
pushImage(name: 'default/example', tag: '1.0', registry: '172.30.101.121:5000')
pushImage(name: 'default/example', tag: '1.0', registry: '172.30.101.122:5000')
pushImage(name: 'default/example', tag: '1.0', registry: '172.30.101.123:5000')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment