Giter Club home page Giter Club logo

example-docker-jenkins's Introduction

Example of running Jenkins CI in a Docker Container

This repository contains example Docker recipes and supporting scripts that demonstrate running Jenkins CI that creates and runs Docker contains within build projects, with the Jenkins CI server itself running in a Docker container. Essentially this is a demonstration of the creation and use of sibling Docker containers.

Requires Docker 1.11 or later.

Tested on OS X El Capitan (10.11.5) using a boot2docker VirtualBox VM, and on Windows 10 Enterprise using a boot2docker Hyper-V VM.

Extension of example from The Docker Book

This example is inspired by the Jenkins CI examples from the Testing with Docker chapter of James Turnbull's The Docker Book (version 1.9.1). I've forked the Git repository he used in the book so that there is a version that stays synchronized with this example.

The example in the book used a technique called "Docker in Docker", in which a Docker container is running its own Docker daemon by which child containers are created. That approach turns out to lead to data corruption if you are not careful.

This reworked example avoids the "Docker in Docker" approach, and instead just shares the host Docker daemon port with the Jenkins CI container. The Docker client in that container will then communicate with the Docker daemon on the host, the same daemon that started that Jenkins CI container. New containers that are started from within the Jenkins CI container are started by the host Docker daemon and are sibling containers. This approach avoids the concurrent access issues and other incompatibilities and race conditions that would lead to corrupted data.

How to perform the examples

  1. Build the base Ubuntu image by cd ubuntu and build.sh
  2. Build the base Docker image by cd docker and build.sh
  3. Build the data volume container by cd jenkins-ci and create-dv-jenkins-workspace.sh
  4. Build the Jenkins CI image by cd jenkins-ci and build.sh
  5. Launch the Jenkins CI container with run.sh
  6. Follow the procedures described in the Jenkins CI examples at the end of the Testing with Docker chapter of The Docker Book.

example-docker-jenkins's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.