Testing our new build agents

Head back to the Jenkins dashboard and click on the Schedule a Build button for our hello-docker-test job. This will start a new build for our job, which in turn will create a new Dockerized build agent. It uses the configuration we set to execute a docker container run command to run a new container based on the image we specified. Initially, the executor will be offline as the container spins up: 

Notice that the executor name has the agent prefix that we specified. Once the container is running, the Jenkins job will be initiated within it, essentially using the docker container exec command. When the Jenkins job has started, the normal job-progress graphic will display, and the executor will no longer show as offline. The status will then look something like this:

If you click on the progress bar of the executing job, you can view the job's console output, and after a short while the job will show the finished: SUCCESS status, like the following:

A job well done! Let's examine one last example Jenkins job to show a pipeline script that has more stages, and represents a real-world example of a Docker job. Are you ready? Read on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset