user jenkins for docker commands
herau opened this issue · 1 comments
I try your slave but i can't run any docker commands.
i have this kind of message
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
How you can execute docker commands whereas the docker container only contains the jenkins
user ?
Docker need a root user to be able to run docker commands right ?
my docker-compose file:
version: '2'
services:
master:
user: root
image: jenkinsci/jenkins
links:
- slave-docker
environment:
- JAVA_OPTS=-Duser.timezone=Europe/Paris
volumes:
- ./data:/var/jenkins_home
ports:
- "50000:50000"
- "8080:8080"
slave-docker:
image: evarga/jenkins-slave
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# static binay of docker
- /home/data/docker/bin/docker:/bin/docker
In Jenkins i have created a slave
The slave container doesn't come preinstalled with Docker. It is just a Linux base image for Jenkins to be able to spin it up as a slave node. You are responsible to further customize it via scripts during boot up. It would be inappropriate to start filling in this base image with all possible supporting sub-systems. I hope this clarifies the intention of this Jenkins slave image.