English 中文(简体)
Docker - Continuous Integration
  • 时间:2024-12-22

Docker - Continuous Integration


Previous Page Next Page  

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 cpck Manage Jenkins.

Manage Jenkins

Step 2 − Go to Manage Plugins.

Manage Plugins

Step 3 − Search for Docker plugins. Choose the Docker plugin and cpck 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.

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, cpck 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 Advertisements