-
Notifications
You must be signed in to change notification settings - Fork 559
jenkins slave dind #66
Comments
+1, having the same issue. |
Sorry, I hadn't seen this report earlier. Are you still trying to use Docker-in-Docker with Jenkins? If yes, I'd recommend to switch to a different mode: just start the Jenkins container with |
Hi , i had exact same issue, but from another docker thread, someone posted a really useful script to create a loopback device.
|
@jpetazzo with your solution of
are you saying we should not use |
Yes, just mount the socket, and then Jenkins can talk directly talk to it, On Thu, Jun 18, 2015 at 2:12 PM, Imran Hayder notifications@github.com
@jpetazzo https://twitter.com/jpetazzo |
Hello all, I have the same kind of need : running Jenkins instances (slaves at first), with docker available. The idead I want to achieve is to use docker's lightweight isolation to "lightly" isolate docker APIs :
So the socket sharing is not a solution for my case, and since I don't have acces to paltform that can be managed by docker-machine, I don't know which path to start with :
|
Just to let you know : jenkinsci/docker-custom-build-environment-plugin#22 |
After all that time, I finally could take a few hours to write a blog post about this: http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ I'll close the issue here, thanks all! |
@jpetazzo I read your article and I completely agree. Sibling containers is just fine and it keeps things much easier. With regards to your suggested solution, do you have it working? I tried making a jenkins slave using your suggestion using volumes for
Is that a artifact of my particular install, or is there more details than what was put into the article? |
Right, that happened when switching to dynamic binaries... There is now an official docker:dind image upstream! I invite you to test it, since it is actively maintained. Thank you! |
@jpetazzo - thanks for the blog post! Very helpful :)
I'm on redhat and installed docker with yum - how do I switch back to static binaries so I can remove those 3 volumes? |
@mattfysh, I'd have two ideas:
HTH! |
I had a need to run a Jenkins CI slave w/ docker. I settled on following @jpetazzo advice jenkins-slave-docker:
build: .
restart: always
container_name: jenkins-slave-docker
environment:
- LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/opt/lib64
ports:
- 0.0.0.0:49255:22
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /usr/lib64/:/opt/lib64/ |
@ghost your suggestion worked for me. |
Hi There,
I have tried create a container that has dind and sshd for jenkins slave. I have tried to do this 3 different ways.
1> Create a container from the jpetazzo/dind.
{code}
Please find buildfile below.
Based on Ubuntu
Set the base image to Ubuntu
FROM jpetazzo/dind
File Author / Maintainer
MAINTAINER Johnathan Phan
Enviroment setup
############ BEGIN INSTALLATION
Update system
RUN apt-get update
Install a basic SSH and docker server
RUN apt-get install -y openjdk-7-jdk openssh-server
RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd
RUN mkdir -p /var/run/sshd
RUN adduser --quiet jenkins
RUN echo "jenkins:jenkins" | chpasswd
RUN usermod -a -G 0 jenkins
ADD scripts/jenkins-slave-startup.sh /
RUN chmod +x jenkins-slave-startup.sh
Standard SSH port
EXPOSE 22
{code}
2> Tried to use https://registry.hub.docker.com/u/tehranian/dind-jenkins-slave/dockerfile/ directly.
3> Tried to create my own container with build file merging commands and files from bother jpetazzo/dind and evarga/jenkins-slave.
I get continous issues concerning running docker in docker with another service.
For example in the first example where I extend dind. I get the following error inside the container.
INFO[0000] +job serveapi(unix:///var/run/docker.sock)
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
WARN[0000] WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors
ERRO[0000] There are no more loopback devices available.
FATA[0000] loopback mounting failed
I don't know why this does'nt work.
Can someone help me?
The text was updated successfully, but these errors were encountered: