Docker - Continuous Integration

Docker has integrations with many Continuous Integrations tools, which also includes the popular CI tool known as Jenkins. Within Jenkins, you have plugins available which can be used to work with containers. So let’s quickly look at a Docker plugin available for the Jenkins tool.

Let’s go step by step and see what’s available in Jenkins for Docker containers.

Step 1 − Go to your Jenkins dashboard and click Manage Jenkins.

Manage Jenkins

Step 2 − Go to Manage Plugins.

Manage Plugins

Step 3 − Search for Docker plugins. Choose the Docker plugin and click the Install without restart button.

Install Without Restart Button

Step 4 − Once the installation is completed, go to your job in the Jenkins dashboard. In our example, we have a job called Demo.


Step 5 − In the job, when you go to the Build step, you can now see the option to start and stop containers.

Add Build step

Step 6 − As a simple example, you can choose the further option to stop containers when the build is completed. Then, click the Save button.

Stop All Containers

Now, just run your job in Jenkins. In the Console output, you will now be able to see that the command to Stop All containers has run.

Console Output