GithubHelp home page GithubHelp logo

jenkins-docker's Introduction

jenkins-docker

GitHub forks GitHub stars Twitter

Running Jenkins 2.0 in Production with Docker.

Nothing to install, the only prerequisite is that you have Docker installed on the server.

Files persists onto the localhost server at /opt/jenkins_home. This makes it resilient to reboots and it is easy to just backup this folder.

Running the Jenkins service

Ubuntu

1) Place the file ./upstart/jenkins.conf on your server /etc/init/jenkins.conf

2) Start it up

service jenkins start

3) Get the password from the log files

docker logs -ft jenkins

You will see this log section. Copy this password:

2016-05-05T17:25:49.011787978Z *************************************************************
2016-05-05T17:25:49.011808021Z *************************************************************
2016-05-05T17:25:49.011814273Z *************************************************************
2016-05-05T17:25:49.011819429Z
2016-05-05T17:25:49.011824960Z Jenkins initial setup is required. An admin user has been created and a password generated.
2016-05-05T17:25:49.011834803Z Please use the following password to proceed to installation:
2016-05-05T17:25:49.011839910Z
2016-05-05T17:25:49.011845543Z e30bed7d3c104005aeadd45de3a60d37
2016-05-05T17:25:49.011850557Z
2016-05-05T17:25:49.011855603Z This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
2016-05-05T17:25:49.011860984Z
2016-05-05T17:25:49.011865623Z *************************************************************
2016-05-05T17:25:49.011871858Z *************************************************************
2016-05-05T17:25:49.011877088Z *************************************************************

4) Go to this URL in your web browser

Go to http://localhost (or whatever the IP of the server is)

You will need the password to go through the setup.

Backup

Manual

Just backup the folder /opt/jenkins_home. If you need to restore, just restore all of the contents to this location and start up Jenkins again.

To S3

You can backup the files to AWS S3 by running this Docker command:

docker run --env aws_key=<YOUR AWS KEY> \
--env aws_secret=<YOUR AWS SECRET> \
--env cmd=sync-local-to-s3 \
--env DEST_S3=s3://my.backup.bucket/jenkins_home/  \
-v /opt/jenkins_home:/opt/src/$(/bin/date +\%Y\%m\%d) \ garland/docker-s3cmd

cron to backup to S3

You can also setup a cron job that uses the S3 backup on a schedule.

  1. Edit your crontab

  2. Add this entry in

0 22 * * *      /usr/bin/docker run --env aws_key=<YOUR AWS KEY> --env aws_secret=<YOUR AWS SECRET> --env cmd=sync-local-to-s3 --env DEST_S3=s3://my.backup.bucket/jenkins_home/  -v /opt/jenkins_home:/opt/src/$(/bin/date +\%Y\%m\%d) garland/docker-s3cmd

This will perform a backup nightly.

jenkins-docker's People

Contributors

sekka1 avatar tvlooy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.