0

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.

supervisord

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

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

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:
aa9c8e22a95c4fcd8a7966983b6ff065
This may also be found at: /root/.jenkins/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
Killed
6
  • 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
    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 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
    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??? 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
    Mar 7, 2018 at 8:12

1 Answer 1

0

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
export JENKINS_HOME

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 .