Skip to content

Instantly share code, notes, and snippets.

@mindw
Forked from mikesplain/Jenkinsfile
Created January 30, 2019 15:02
Show Gist options
  • Select an option

  • Save mindw/5239295c6db1950b32a7b5d7bf02ca7e to your computer and use it in GitHub Desktop.

Select an option

Save mindw/5239295c6db1950b32a7b5d7bf02ca7e to your computer and use it in GitHub Desktop.
Jenkins kubernetes dind
podTemplate(label: 'mypod', containers: [
containerTemplate(name: 'docker', image: 'docker:dind', ttyEnabled: true, alwaysPullImage: true, privileged: true,
command: 'dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay')
],
volumes: [emptyDirVolume(memory: false, mountPath: '/var/lib/docker')]) {
node ('mypod') {
stage 'Run a docker thing'
container('docker') {
stage 'Docker thing1'
sh 'docker pull redis'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment