jenkins in docker

31 views
Skip to first unread message

jb

unread,
Nov 5, 2015, 12:04:36 PM11/5/15
to Jenkins Users
Hello all,

I am new to docker and jenkins and decided to pull in the official jenkins docker image. I have two containers running separate instances of jenkins on different ports.

I started a container with the below command:
docker run -d -p 8082:8080 -u 1003:1002 -v /webappsjenkins:/var/jenkins_home --name webappsjenkins jenkins

I started my second container with the next command:
docker run -d -p 8081:8080 -u 1002:1002 -v /mesjenkins:/var/jenkins_home --name mesjenkins jenkins


So I'm aware each container is supposed to host everything needed for it's own instance. Also my -v switch should have put everything needed for /var/jenkins_home in where I specified. I also believe JDK and Maven are included in the image. 

My ultimate question is what are the paths to jdk and maven from the official docker image? 

If this doesn't make sense please let me know and I will try to specify any additional information needed. I could not find this information on any of the resources I used:
https://github.com/jenkinsci/docker

Baptiste Mathus

unread,
Nov 5, 2015, 6:07:20 PM11/5/15
to jenkins...@googlegroups.com
inline.

2015-11-05 18:04 GMT+01:00 jb <josh.b...@sanmina.com>:
Hello all,

I am new to docker and jenkins and decided to pull in the official jenkins docker image. I have two containers running separate instances of jenkins on different ports.

I started a container with the below command:
docker run -d -p 8082:8080 -u 1003:1002 -v /webappsjenkins:/var/jenkins_home --name webappsjenkins jenkins

I started my second container with the next command:
docker run -d -p 8081:8080 -u 1002:1002 -v /mesjenkins:/var/jenkins_home --name mesjenkins jenkins


So I'm aware each container is supposed to host everything needed for it's own instance. Also my -v switch should have put everything needed for /var/jenkins_home in where I specified. I also believe JDK and Maven are included in the image. 

My ultimate question is what are the paths to jdk and maven from the official docker image? 

JDK: 

$ docker run --rm java:8-jdk which java
/usr/bin/java
 
I don't think Maven is included. In my opinion, this is a good thing: you should generally try not to run things on your master.


If this doesn't make sense please let me know and I will try to specify any additional information needed. I could not find this information on any of the resources I used:
https://github.com/jenkinsci/docker

IIUC what you're trying to do, this plugin has nothing to do here. It's designed to run nodes (aka slaves) in Docker containers. (In your case here, that would then you would have the master running in Docker, contacting slaves, running in containers).

HTH

-- Baptiste
Reply all
Reply to author
Forward
0 new messages