From 8956d43c47ab01c1a368481b549e11acc3152c99 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 28 Aug 2016 14:40:22 -0500 Subject: [PATCH] [jenkins] Declare VOLUME for home directory --- jenkins/Dockerfile | 5 +++-- jenkins/README.md | 32 +++++++++++++++++--------------- jenkins/download-and-start.sh | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/jenkins/Dockerfile b/jenkins/Dockerfile index c8c545cf..e7ffdeca 100644 --- a/jenkins/Dockerfile +++ b/jenkins/Dockerfile @@ -4,8 +4,9 @@ MAINTAINER itzg ADD download-and-start.sh /download-and-start -ENV JENKINS_HOME /data -VOLUME ["/data"] +ENV JENKINS_HOME=/data + +VOLUME ["/data", "/root", "/opt/jenkins"] EXPOSE 8080 38252 CMD ["/download-and-start"] diff --git a/jenkins/README.md b/jenkins/README.md index 6d3d0c34..c8f6df69 100644 --- a/jenkins/README.md +++ b/jenkins/README.md @@ -18,21 +18,6 @@ would be: ID=$(docker run -d -p 8080:8080 -v /SOME_HOST_DIR:/data itzg/jenkins -# Entering the container to perform manual config - -As with any Docker container, you can run a shell within the running container: - - docker exec -it $ID bash - -A more realistic example is installing git, openjdk-7-jdk, etc: - - docker exec $ID apt-get update - docker exec $ID apt-get install -y git openjdk-7-jdk - -and then Configure the JDK in Jenkins: - -![](http://i.imgur.com/HVetwKc.png) - # Enabling Jenkins slave agents By default, Jenkins will pick a random port to allow slave nodes launched @@ -47,3 +32,20 @@ Launch your Jenkins container using and configure the port in the Global Security settings: ![](http://i.imgur.com/PhQiEHy.png) + +# Image Parameters + +## Volumes + +* `/data` - a majority of the Jenkins content is maintained here, such as workspaces +* `/root` - some tools, such as Maven, utilize the home directory for default repository storage +* `/opt/jenkins` - the installed distribution is expanded here + +## Ports + +* `8080` - for the web UI +* `38252` - for slave incoming JMX access + +## Environment Variables + +* `JENKINS_OPTS` - passed to the initial Java invocation of Jenkins diff --git a/jenkins/download-and-start.sh b/jenkins/download-and-start.sh index a930a0b9..6cb7f32e 100755 --- a/jenkins/download-and-start.sh +++ b/jenkins/download-and-start.sh @@ -26,4 +26,4 @@ fi cd /opt/jenkins -exec java -jar jenkins.war +exec java $JENKINS_OPTS -jar jenkins.war