docker-minecraft-server/jenkins
2015-02-17 19:35:39 -06:00
..
Dockerfile Adding a fixed port for JNLP launched slave agents 2015-02-17 19:32:47 -06:00
download-and-start.sh [jenkins] Initial commit of self-upgrading Jenkins 2015-02-16 22:30:06 -06:00
README.md [jenkins] Added JNLP port info to README 2015-02-17 19:35:39 -06:00

A self-upgrading Jenkins CI server

Basic Usage

To start Jenkins with the latest version:

ID=$(docker run -d -p 8080:8080 itzg/jenkins)

At a later time, you can upgrade by restarting the container:

docker stop $ID
docker start $ID

Attaching host directory to Jenkins home directory

The Jenkins home directory is attachable at /data, so attaching to a host volume 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:

Enabling Jenkins slave agents

By default, Jenkins will pick a random port to allow slave nodes launched by JNLP. Since Docker networking is basically a firewall, a random port won't work for us. Instead the fixed port 38252 was chosen (arbitrarily) to be exposed by the container.

Launch your Jenkins container using

ID=$(docker run -d -p 8080:8080 -p 38252:38252 itzg/jenkins)

and configure the port in the Global Security settings: