[jenkins] Declare VOLUME for home directory

This commit is contained in:
Geoff Bourne
2016-08-28 14:40:22 -05:00
parent 911fcf8b42
commit 8956d43c47
3 changed files with 21 additions and 18 deletions

View File

@@ -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"]

View File

@@ -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

View File

@@ -26,4 +26,4 @@ fi
cd /opt/jenkins
exec java -jar jenkins.war
exec java $JENKINS_OPTS -jar jenkins.war