i have created a Dockerimage which is using supervisord to start multiple services, 2 of them are working but the 3rd jenkins service start and then gets killed on its own.


ubuntu@kops:~/cluster/gui$ cat supervisord.conf

command=/usr/sbin/sshd -D
command=/usr/bin/java -jar /usr/share/jenkins/jenkins.war
command=/usr/bin/vncserver :1 -geometry 1280x800 -depth 24 && tail -f /root/.vnc/*:1.log

Inside docker container, when i manually start jenkins service,

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
This may also be found at: /root/.jenkins/secrets/initialAdminPassword
  • Did you try setting it up using the initial password provided? BTW, once you've figured out how to set it up manually, you'll need to do the same thing in the Dockerfile you used to create the container (or, at least, copy in a working config file for jenkins).
    – cas
    Commented Mar 7, 2018 at 5:46
  • well it gets killed automatically the moment it starts,,plus the supervisord. file would start the service for jenkins ,,ryt,,i only specified to use supervisord.conf as mentioned above as my entry point in container Commented Mar 7, 2018 at 6:30
  • huh? I wasn't asking about supervisord. the error message clearly states that jenkins needs to be configured. I was asking if you had done that.
    – cas
    Commented Mar 7, 2018 at 6:38
  • see, before adding the gui service, i never configured jenkins, it still showed the initial password page, now only after add the gui, i am facing this issue??? Commented Mar 7, 2018 at 6:48
  • This may seem like a really weird idea but if the error message is telling you that Jenkins needs to be configured, maybe you should try configuring it. Maybe that will solve your problem.
    – cas
    Commented Mar 7, 2018 at 8:12

1 Answer 1


I know this thread is old but it still shows up in google searchs.

I also had this issue. The reason is that command doesn't have $JENKINS_HOME set so it takes current command's directory -> /usr/bin/java as JENKINS_HOME.

You can simple pass export JENKINS_HOME=/var/lib/jenkins before command. But best way is to load /etc/defaults/jenkins file and export variable which is set there. You do this the same way as it is done in /etc/init.d/jenkins file.

[ -r /etc/default/jenkins ] && . /etc/default/jenkins

Finally I would strongly suggest to take a closer look at this ... https://wiki.jenkins.io/display/JENKINS//Starting+and+Accessing+Jenkins ... and whole /etc/init.d/jenkins and use some parts of it to run the jenkins properly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .