These are container that are being used @ i-net software
Our previous build architecture relied on severeal VMs running Windows and Jenkins (for different product lines), each about 40-80GB in size. Each time we had a software branch we needed to copy the whole VM to be able to reproduce this state. What was in these images?
This setup eats quite a lot of backup space. In addition to the SVN repository we're using for several years now.
It is obvious:
We introduced JFrogs Artifactory as an IVY repository and had all the static files served from there or use the publicly available versions using Artifactories cache.
We're now pushing all artifacts, as well as the final product executables into this repository.
The build slaves running Ubuntu and Fedora have been replaced with Docker images. This bares us of three VMs already. Now we only need a bare metal OSX machine and a Windows machine for specific tasks. The rest, including GUI-tests is being done using Docker.
Thinking about the new Architecture. In the end it will look like this:

In short words:
Here is the example project.
There seems to be a lot of Voodoo here ;) - I'll try to add examples so this will be easier to understand. But know this:
The Discovery is strictly decoupled from the Swarm setup
The Jenkins configuration is decoupled from the Discovery Service
We have a Gradle project (doh, something new again - but the demo project has you covered) which sets up the Jenkins Masters with just one line
gradle jenkins:start
##Swarm Setup
We're using the following hosts for documentation purposes:
The following lines apply to all hosts from the list above.
/etc/default/docker has the line:
DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock"4243service docker restart if neededThe following command creates the docker Swarm Token. It has to be used from now on when adding a new swarm node and is used for autodiscovery of the Swarm Manager:
jenkins-host@bash:~/$ docker run --rm swarm create
<DOCKER_SWARM_TOKEN>
Start the Swarm Manager now - The image will be restarted on reboots:
jenkins-host@bash:~/$ docker run -dp 2375:2375 --restart=always --name=swarm-manager swarm manage token://<DOCKER_SWARM_TOKEN>
On our internal server we are using dockerui to check images that are running
docker run -dp 9000:9000 --restart=always --name=dockerui dockerui/dockerui
Start the first Swarm Node - beware the --addr= which represents the current computer IP
fileserver@bash:~/$ docker run -d --restart=always --name=swarm-agent swarm join --addr=10.10.10.10:4243 token://<DOCKER_SWARM_TOKEN>
Start the second
fileserver2@bash:~/$ docker run -d --restart=always --name=swarm-agent swarm join --addr=10.10.10.11:4243 token://<DOCKER_SWARM_TOKEN>
host@bash:~/$ docker run -d --restart=always --name=swarm-agent swarm join --addr=$(hostname -I | awk '{print $1}'):4243 token://<DOCKER_SWARM_TOKEN>
The Windows Swarm node will be used together with our custom Windows Docker Images.
You need to have a windows docker server running (tested with Windows Server 2016. See here for reference of the swarm image used.
$TOKEN="<DOCKER_SWARM_TOKEN>"
$ip=( (Get-NetIPAddress | Where-Object -FilterScript { $_.InterfaceAlias -Eq "Ethernet" } | select-object IPAddress)[1].IPAddress)
Write-Host "Adding host $($ip):2375 to swarm"
docker run --restart=always -d --name=swarm-agent stefanscherer/swarm-windows:latest-nano join "--addr=$($ip):2375" "token://$TOKEN"
Content type
Image
Digest
sha256:a884f34cf…
Size
415.8 MB
Last updated
10 months ago
docker pull inetsoftware/alpine-java-gradle