Jenkins · Declarative pipeline basics
Run in a Docker container
Run the pipeline inside a container image, so builds have the tools they need.
agent {
docker { image 'node:24' }
}
Official Jenkins documentation
More declarative pipeline basics commands
- A minimal Jenkinsfile
- Set environment variables
- Set pipeline options
- Ask for parameters
- Run on a schedule
- Run a stage conditionally
All declarative pipeline basics commands · Jenkins cheatsheet