Skip to content

Instantly share code, notes, and snippets.

@naturalett
Created May 14, 2023 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naturalett/366ef9e4dcfefd56b4231a540918d16c to your computer and use it in GitHub Desktop.
Save naturalett/366ef9e4dcfefd56b4231a540918d16c to your computer and use it in GitHub Desktop.
Run a Containerized Jenkins Environment with Docker Agent for Seamless Integration!
pipeline {
agent {
docker {
image 'docker:19.03.12'
args '-v /var/run/docker.sock:/var/run/docker.sock'
}
}
stages {
stage('Clone') {
steps {
git branch: 'main', url: 'https://github.com/naturalett/hello-world.git'
}
}
stage('Build') {
steps {
script {
docker.build("hello-world")
}
}
}
}
post {
success {
script {
currentBuild.description = "Passed successfully!"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment