Using jenkins as a base image for Docker conatainer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using jenkins as a base image for Docker conatainer

jorge alarcon
Hello everyone,
I am porting some old code I had for jenkins, version 1.X.X. For this I had a Dockerfile that looked like this:

FROM jenkins:1.609.1

MAINTAINER Jorge Alarcon

# Create Jenkins Log Folder
USER root
RUN mkdir /var/log/jenkins
RUN chown -R jenkins:jenkins /var/log/jenkins
USER jenkins

# Set default options
ENV JAVA_OPTS="-Xmx8192m"
ENV JENKINS_OPTS="--handlerCountStartup=100 --handlerCountMax=300 --logfile=/var/log/jenkins/jenkins.log"


However, If I use jenkins 2.60.X or the image jenkins/jenkins:lts when I run docker run -p 8080:8080 -p 5000:5000 myjenkins, there is no jenkins server visible on localhost:8080.
As a matter of fact the container is not even really running.
I was wondering if anyone else has come upon the same issue?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e3bfd397-ca7d-4afa-86c3-7943399c268f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using jenkins as a base image for Docker conatainer

Eric Tan
I think you are missing the volume mapping:

-v $HOST_VOLUME:/var/jenkins_home



On Friday, 29 September 2017 11:06:47 UTC+8, jorge alarcon wrote:
Hello everyone,
I am porting some old code I had for jenkins, version 1.X.X. For this I had a Dockerfile that looked like this:

FROM jenkins:1.609.1

MAINTAINER Jorge Alarcon

# Create Jenkins Log Folder
USER root
RUN mkdir /var/log/jenkins
RUN chown -R jenkins:jenkins /var/log/jenkins
USER jenkins

# Set default options
ENV JAVA_OPTS="-Xmx8192m"
ENV JENKINS_OPTS="--handlerCountStartup=100 --handlerCountMax=300 --logfile=/var/log/jenkins/jenkins.log"


However, If I use jenkins 2.60.X or the image jenkins/jenkins:lts when I run docker run -p 8080:8080 -p 5000:5000 myjenkins, there is no jenkins server visible on localhost:8080.
As a matter of fact the container is not even really running.
I was wondering if anyone else has come upon the same issue?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ad2cfe49-d831-4d6e-8778-863886daa253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.