Book Image

Continuous Delivery with Docker and Jenkins

By : Rafał Leszko
Book Image

Continuous Delivery with Docker and Jenkins

By: Rafał Leszko

Overview of this book

The combination of Docker and Jenkins improves your Continuous Delivery pipeline using fewer resources. It also helps you scale up your builds, automate tasks and speed up Jenkins performance with the benefits of Docker containerization. This book will explain the advantages of combining Jenkins and Docker to improve the continuous integration and delivery process of app development. It will start with setting up a Docker server and configuring Jenkins on it. It will then provide steps to build applications on Docker files and integrate them with Jenkins using continuous delivery processes such as continuous integration, automated acceptance testing, and configuration management. Moving on you will learn how to ensure quick application deployment with Docker containers along with scaling Jenkins using Docker Swarm. Next, you will get to know how to deploy applications using Docker images and testing them with Jenkins. By the end of the book, you will be enhancing the DevOps workflow by integrating the functionalities of Docker and Jenkins.
Table of Contents (10 chapters)

Exercises

We have learned a lot about Jenkins configuration throughout this chapter. To consolidate the knowledge, we recommend two exercises on preparing the Jenkins images and testing the Jenkins environment.

  1. Create Jenkins master and slave Docker images and use them to run the Jenkins infrastructure capable of building the Ruby projects:
    • Create the master Dockerfile, which automatically installs the Docker plugin.
    • Build the master image and run the Jenkins instance
    • Create the slave Dockerfile (suitable for the dynamic slave provisioning), which installs the Ruby interpreter
    • Build the slave image
    • Change the configuration in the Jenkins instance to use the slave image
  2. Create a pipeline, which runs a Ruby script printing Hello World from Ruby:
    • Create a new pipeline
    • Use the following shell command to create the hello.rb script on the fly:
      sh "echo "puts 'Hello...