wiki:WikiStart/BuildServer/DockerChroot

Version 6 (modified by stpl01, 4 years ago) (diff)

--

Get docker runnig on the host

follow: https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin (without ssh setup)

add the hosts "jenkins" user user to the docker group

http://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo

get into the container with

docker run -i -t -v /data/jenkins:/data/jenkins ubuntu_1404 /bin/bash

inside, the container:

apt-get update

#install build essentials
apt-get install lsb-release default-jre wget ruby openssh-client git


#install locales
apt-get install locales
# Select en_US.UTF-8 in the dialog shown below
locale-gen en_US.UTF-8

#create workspace

mkdir -p /data/jenkins/workspace

ssh-keygen
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

echo "id to add to git server"
cat /root/.ssh/id_rsa.pub 

git config --global user.email "ag-framework@dfki.de"
git config --global user.name "Buildserver"

Commit it to a new node name

to run the slave manage the jenkins nodes and add the line

docker run -i -v /data/jenkins:/data/jenkins ubuntu_1404_v1 /data/jenkins/build_scripts/jenkins_docker_slave

IMPORTANT

re-launch the slave after each commit to the image!