Quantcast
Channel: Platform as a Service Magazine » Cyrille Le Clerc
Viewing all articles
Browse latest Browse all 10

Architecture: Integrating the CloudBees Jenkins Platform with Docker Hub 2.0

$
0
0

Docker is an incredibly hot topic these days. Its role in Jenkins infrastructures will soon become predominant as companies are discovering how Docker fits within their own environments as well as how to use Docker and Jenkins together most effectively across their software delivery pipelines.

The major use cases for Docker in a Jenkins infrastructure are:

  • Customize the build environment: Different applications often require different build tools, some of these tools require root permissions to be installed on the build servers (x11/xvfb and Firefox for headless tests such as selenium, ImageMagick…). Jenkins admins once solved this problem by increasing the number of flavors of Jenkins slaves, but it was limited by hardware constraints and was not flexible for project teams. The CloudBees Docker Custom Build Environment Plugin and the CloudBees Docker Workflow Plugin offer a new way to solve this challenge with much more flexibility, allowing Jenkins admins to manage only one flavor of Jenkins slaves—Docker enabled slaves—and let the project team customize their build environment to their needs running their jobs in Docker containers.
  • Ship applications as Docker images: More and more applications get shipped as Docker images (instead of war/exe/… files) and the Continuous Integration platform has to build and publish these Docker images.

For these scenarios, the Jenkins infrastructure needs to access to a Docker registry to retrieve/pull the Docker images used on Docker enabled slaves and to store/push the Docker images created by Jenkins builds.

Docker Hub

The Docker Hub is the cloud-based registry service proposed by Docker, Inc that combines the “official” registry of public images on which “every” Docker user relies with a private registry that will allow the user to manage private images.

Integrating a Jenkins infrastructure with Docker Hub requires architecture decisions that are similar to the decisions to integrate a Jenkins infrastructure with online services such as GitHub or BitBucket.

Direct connectivity from the Jenkins infrastructure to Docker Hub

The most straightforward solution is to simply open network connectivity (http and https) from the Jenkins slaves to Docker Hub.

Architecture: Jenkins infrastructure and hub.docker.com

Connecting the Jenkins infrastructure to Docker Hub through a proxy

Several organisations will prefer to secure the connectivity of the Jenkins infrastructure to the “outside world” with firewalls and proxies.

To do so, it is necessary to declare the HTTP proxy in the configuration of the Docker daemon on each Jenkins slaves as documented in Docker Documentation – Control and configure Docker with systemd – HTTP Proxy.

Sample /etc/systemd/system/docker.service.d/http-proxy.conf:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

Architecture: Jenkins infrastructure and hub.docker.com through an HTTP proxy

Private Docker Registries behind firewalls?

This blog post covered how to integrate a Jenkins infrastructure with the Docker Hub public registry service. We will cover in seperate post the integration of a Jenkins infrastructure with a private registry behind the firewalls.

Accessing the Docker Hub registry in Jenkins jobs

To see how to access to the Docker Hub registry and to manage your credentials in Jenkins jobs, please read Nicolas de Loof’s blog post Docker Hub 2.0 Integration with CloudBees Jenkins Platform and watch the screencast:


Cyrille Le Clerc is a product manager at CloudBees, with more than 15 years of experience in Java technologies. He came to CloudBees from Xebia, where he was CTO and architect. Cyrille was an early adopter of the “You Build It, You Run It” model that he put in place for a number of high-volume websites. He naturally embraced the DevOps culture, as well as cloud computing. He has implemented both for his customers. Cyrille is very active in the Java community as the creator of the embedded-jmxtrans open source project and as a speaker at conferences.

The post Architecture: Integrating the CloudBees Jenkins Platform with Docker Hub 2.0 appeared first on Platform as a Service Magazine.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images