// Example Jenkinsfile for DooD (Docker-out-of-Docker) builds // Jenkins spawns a temporary container with the specified image, // runs the build inside it, and cleans up when done. pipeline { // Each stage can use a different Docker image agent none stages { stage('Build') { agent { docker { image 'node:20' } } steps { sh 'npm install' sh 'npm run build' } } stage('Test') { agent { docker { image 'node:20' } } steps { sh 'npm test' } } // Example: stage with a different image // stage('Deploy') { // agent { // docker { image 'alpine:latest' } // } // steps { // sh 'echo "Deploying..."' // } // } } }