# Jenkins: java.lang.NoSuchMethodError: No such DSL method 'dockerBuild' found among steps

**Code:** `No such DSL method` · **Category:** CI/CD · **Seen on:** Jenkins

The Jenkinsfile calls a step that does not exist — the plugin is not installed, or the name or argument is wrong.

## Meaning

Steps come from plugins or shared libraries. Check the Pipeline Syntax snippet generator (`/pipeline-syntax`) to see which steps exist on your controller. A missing step usually means a plugin is missing or disabled, a shared library was not loaded with `@Library`, or the step name is misspelled.

## Common causes

- Plugin that provides the step is not installed/enabled
- Shared library not imported (`@Library('x') _`)
- Typo or wrong case in the step name
- Step used inside the wrong block (e.g. `steps` vs script)
- Library version/branch does not contain the step

## Quick fix

1. Check /pipeline-syntax for the step
2. Install the plugin or add `@Library('name@version') _`
3. Fix the spelling and parameter names

## Detailed fix by platform

### Jenkins

1. Add at top of file: `@Library('shared-lib@main') _`

## Code examples

### Import the library first

```groovy
@Library('shared-lib@main') _
pipeline {
  agent any
  stages { stage('Build') { steps { dockerBuild image: 'app' } } }
}
```

## How to diagnose

1. **Step** — Which step is missing?
2. **Plugin** — Installed?
3. **Library** — Loaded?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/jenkins-no-such-dsl-method)
