Giter Club home page Giter Club logo

jenkins's Introduction

Jenkins Docker Image

This repository contains Dockerfiles for a Jenkins Docker image intended for use with OpenShift v3

For an example of how to use it, see this sample.

The image is pushed to DockerHub as openshift/jenkins-1-centos7.

Versions

Jenkins versions currently provided are:

  • jenkins-1.6x

RHEL versions currently supported are:

  • RHEL7

CentOS versions currently supported are:

  • CentOS7

Installation

Choose either the CentOS7 or RHEL7 based image:

  • RHEL7 based image

    To build a RHEL7 based image, you need to run Docker build on a properly subscribed RHEL machine.

    $ git clone https://github.com/openshift/jenkins.git
    $ cd jenkins
    $ make build TARGET=rhel7 VERSION=1
    
  • CentOS7 based image

    This image is available on DockerHub. To download it run:

    $ docker pull openshift/jenkins-1-centos7
    

    To build a Jenkins image from scratch run:

    $ git clone https://github.com/openshift/jenkins.git
    $ cd jenkins
    $ make build VERSION=1
    

Notice: By omitting the VERSION parameter, the build/test action will be performed on all provided versions of Jenkins. Since we are currently providing only version 1, you can omit this parameter.

Environment variables

The image recognizes the following environment variables that you can set during initialization by passing -e VAR=VALUE to the Docker run command.

Variable name Description
JENKINS_PASSWORD Password for the 'admin' account

You can also set the following mount points by passing the -v /host:/container flag to Docker.

Volume mount point Description
/var/lib/jenkins Jenkins config directory

Notice: When mouting a directory from the host into the container, ensure that the mounted directory has the appropriate permissions and that the owner and group of the directory matches the user UID or name which is running inside the container.

Plugins

In order to install additional Jenkins plugins, the OpenShift Jenkins image provides a way how to add those by layering on top of this image. The derived image, will provide the same functionality as described in this documentation, in addition it will also include all plugins you list in the plugins.txt file.

To create derived image, you have to write following Dockerfile:

FROM openshift/jenkins-1-centos7
COPY plugins.txt /opt/openshift/configuration/plugins.txt
RUN /usr/local/bin/plugins.sh /opt/openshift/configuration/plugins.txt

The format of plugins.txt file is:

pluginId:pluginVersion

For example, to install the github Jenkins plugin, you specify following to plugins.txt:

github:1.11.3

After this, just run docker build -t my_jenkins_image -f Dockerfile.

Furthermore, there are now 2 plugins of note included in this Jenkins Docker image that specifically facilitate the creation of CI/CD jobs and workflows for OpenShift v3:

Usage

For this, we will assume that you are using the openshift/jenkins-1-centos7 image. If you want to set only the mandatory environment variables and store the database in the /tmp/jenkins directory on the host filesystem, execute the following command:

$ docker run -d -e JENKINS_PASSWORD=<password> -v /tmp/jenkins:/var/lib/jenkins openshift/jenkins-1-centos7

Jenkins admin user

The admin user name is set to admin and you have to to specify the password by setting the JENKINS_PASSWORD environment variable. This process is done upon initialization.

Test

This repository also provides a test framework which checks basic functionality of the Jenkins image.

Users can choose between testing Jenkins based on a RHEL or CentOS image.

  • RHEL based image

    To test a RHEL7 based Jenkins image, you need to run the test on a properly subscribed RHEL machine.

    $ cd jenkins
    $ make test TARGET=rhel7 VERSION=5.5
    
  • CentOS based image

    $ cd jenkins
    $ make test VERSION=1
    

Notice: By omitting the VERSION parameter, the build/test action will be performed on all provided versions of Jenkins. Since we are currently providing only version 1, you can omit this parameter.

jenkins's People

Contributors

bparees avatar mfojtik avatar gabemontero avatar warmi01 avatar liggitt avatar stevekuznetsov avatar

Watchers

Sarad Thapa avatar Marc Quadri avatar  avatar  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.