Docker: Error on executing groovy script

Created on 20 Jul 2015  路  5Comments  路  Source: jenkinsci/docker

Running OSX on the bare metal, with the Docker daemon running in a boot2docker VM. I used this command:

docker run -p 8080:8080 -p 50000:50000 jenkins

No fancy volume mounting. The image is downloaded perfectly, but the container consistently gets held up during the groovy script execution. Output looks like this:

docker@boot2docker:~$ docker run -p 8080:8080 -p 50000:50000 jenkins
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Jul 19, 2015 10:19:22 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jul 19, 2015 10:19:24 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.8
Jul 19, 2015 10:19:26 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Jul 19, 2015 10:19:27 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started [email protected]:8080
Jul 19, 2015 10:19:27 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Jul 19, 2015 10:19:27 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Jul 19, 2015 10:19:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Jul 19, 2015 10:19:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Jul 19, 2015 10:19:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Jul 19, 2015 10:19:41 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Jul 19, 2015 10:19:46 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Jul 19, 2015 10:19:46 PM jenkins.util.groovy.GroovyHookScript execute
INFO: Executing /var/jenkins_home/init.groovy.d/tcp-slave-agent-port.groovy
Jul 19, 2015 10:19:49 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Jul 19, 2015 10:19:50 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 48991
Jul 19, 2015 10:19:50 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Jul 19, 2015 10:19:50 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
Jul 19, 2015 10:19:53 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Jul 19, 2015 10:19:53 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Jul 19, 2015 10:19:53 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tasks.Ant.AntInstaller
Jul 19, 2015 10:19:56 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tools.JDKInstaller
Jul 19, 2015 10:19:56 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 6,987 ms
--> setting agent port for jnlp

Process consistently gets stuck at

Jenkins.instance.setSlaveAgentPort(50000)

I have very little experience with Jenkins or Groovy. Any ideas?

Most helpful comment

Yes it worked! Sorry, I'm used to having process run as daemon by default. For others' reference, if you want to run in the background use the -d option.

docker run -d -p 8080:8080 -p 50000:50000 jenkins

All 5 comments

what do you mean gets stuck? that's typically the last log entry after docker run. Can you access the docker server at 8080 ?

Yes it worked! Sorry, I'm used to having process run as daemon by default. For others' reference, if you want to run in the background use the -d option.

docker run -d -p 8080:8080 -p 50000:50000 jenkins

I am following this tutorial but unbale to install jenkins help please
https://jenkins.io/doc/tutorials/create-a-pipeline-in-blue-ocean/

I still don't get it. If I do
docker run --name myJenkinsContainer -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkinsci/jenkins:lts
I still get stuck on
--> setting agent port for jnlp... done
What should I do?

Was this page helpful?
0 / 5 - 0 ratings