Skip to content

EqualMedia/jenkins-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins-docker

Docker built image is hosted here: https://registry.hub.docker.com/u/state/jenkins/

Jenkins docker image. Jenkins configuration can be synced from AWS S3 bucket at startup.

By default there is only one-way configuration sync, but you can set up a jenkins job which syncs ${JENKINS_HOME} to the same S3 bucket, so next time you start this container you will have all your config loaded at startup time.

If JENKINS_HOME_S3_BUCKET_NAME is set, bucket config will be written out to /etc/jenkins-bucket-config, which is used by /srv/jenkins/jenkins_backup.sh. So you can just simply create a jenkins job which runs the backup script.

The image is based on Fedora base image. It has docker, git, aws cli tools and obviously Jenkins preinstall.

Configuration

Configuration is done using environment variables.

Authentication to S3 bucket can be passed in via AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID or EC2 instance IAM role.

  • JENKINS_HOME Default: /var/lib/jenkins. If you decide to change this, make sure you run docker container with -v <new_jenkins_home> set
  • JENKINS_HOME_S3_BUCKET_NAME Default: unset. If unset, config sync will not run
  • JAVA_OPTS Default: unset.
  • JENKINS_OPTS Default: unset. Any valid jenkins parameter is supported

Running

docker run \
  -e AWS_SECRET_ACCESS_KEY=xxx \
  -e AWS_ACCESS_KEY_ID=xxx \
  -e JENKINS_HOME_S3_BUCKET_NAME=example-jenkinsconfig-us-east-1 \
  -p 8080:8080 state/jenkins

About

Jenkins docker image with config data S3 sync support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages