To create Docker containers (build agents) on the fly, we need to install the Docker plugin for Jenkins. To achieve this, follow the given steps:
- From the Jenkins dashboard, click on Manage Jenkins | Manage Plugins | Available tab. You will be taken to the Jenkins Manage Plugins page.
- Enter Docker Plugin in the Filter field, as shown in the following screenshot:
Installing the Docker plugin
- Select the Docker Plugin from the list and click on the Install without restart button.
- Restart Jenkins if needed.