jenkins web page not launching when run from docker

26 views
Skip to first unread message

Anil

unread,
Feb 2, 2021, 3:43:22 PM2/2/21
to Jenkins Users
Jenkins 2.263.3 LTS Windows 10 Home Docker Windows Ubuntu 

I am learning Jenkins and was trying to run it in a docker image.
I started up Docker Desktop and clicked Run on jenkins:lts
However when I go to localhost:8080, this is what I see, and not the Jenkins web page.


Capture.PNG

Slide

unread,
Feb 2, 2021, 9:05:53 PM2/2/21
to Jenkins User Mailing List
What does your docker command look like?

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b3bf430d-c036-400a-8672-4ff858e782ben%40googlegroups.com.

Mark Waite

unread,
Feb 2, 2021, 10:21:45 PM2/2/21
to Jenkins Users
I think you've mistakenly mapped port 8080 on the Windows computer to port 50000 in the running Docker container.  I see that output if I open http://localhost:50000 on a Docker container started by the Docker Desktop app on Windows 10 with port 50000 mapped to 500000.

You need to map port 8080 on the Windows computer to port 8080 in the running Docker container.

image.png

Interesting user interface choice of Docker Desktop that they default to show port 50000 as a possible port to map, but by default they do not show port 8080.  I had to press the "+" character to the right of the row containing port 50000.

Mark Waite

Anil

unread,
Feb 3, 2021, 10:28:11 AM2/3/21
to Jenkins Users

In an ubuntu terminal (Windows 10 Home WSL2) I ran the provided code from the tutorial (Jenkins Essential Training):

I ran it under root

useradd jenkins -m 
docker run \
 -u jenkins \
 --rm \
 -d \
 -p 8080:8080 \
 -p 50000:50000 \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /home/jenkins:/var/jenkins_home \
 jenkins/jenkins:lts 
cat /home/jenkins/secrets/initialAdminPassword

I think it may have something to do with the filesystem.
When I cat /home/jenkins/secrets/initialAdminPassword
it cannot find the file.
Is there  something I should do to map the drive?


Anil

unread,
Feb 3, 2021, 10:29:37 AM2/3/21
to Jenkins Users
In my reply above, I posted the command.
I think it may have something to do with the filesystem.
When I cat /home/jenkins/secrets/initialAdminPassword
it cannot find the file.
Is there  something I should do to map the drive correctly?

Anil

unread,
Feb 3, 2021, 1:09:44 PM2/3/21
to Jenkins Users

The earlier instructions had:

Launching Jenkins can then be accomplished with a simple docker command
as the root user (copy/paste to your VM):

  sudo su -
  docker run --name jenkins --rm -u root -d -p 8080:8080 -p 50000:50000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins:/var/jenkins_home jenkins/jenkins:lts


But I had already installed Docker.


root:~#   docker run --name jenkins --rm -u root -d -p 8080:8080 -p 50000:50000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins:/var/jenkins_home jenkins/jenkins:lts
88bd4006e1fbef8faf2d0652f4d56dec12fd1206c24fb2d3c6fa7ee8a8a3008c
docker: Error response from daemon: driver failed programming external connectivity on endpoint jenkins (4cd8f8c2ee5d501f93f830f6932c383b5948ca77520f4ba3757f2dcf30e3d5d2): Bind for 0.0.0.0:50000 failed: port is already allocated.

Anil

unread,
Feb 3, 2021, 1:28:29 PM2/3/21
to Jenkins Users
It started working. I don't know what fixed it but these are what I tried:

1) In Docker Desktop, reset all data to factory defaults
2) Created ubuntu root password and su - 
3) Turned off experimental Docker feature "cloud enabled".
4) I found the secret admin password in the Console in Docker desktop, not in the ubuntu shell.

Now I was able to go to localhost:8080 and enter the admin password.

thanks to all who replied!

Tej Singh Rana

unread,
Feb 3, 2021, 2:03:40 PM2/3/21
to jenkins...@googlegroups.com
Hello, Anil
Your previous docker command has created a container and that's using that 50000 port. Remove that container first then rerun docker command again.
To list the inactive container:
docker ps -a
To rm container:
docker rm <container-name>

Regards,



--
---------------------
Tej Singh Rana

Anil

unread,
Feb 3, 2021, 4:31:35 PM2/3/21
to Jenkins Users
root:/home/jenkins# docker ps -a
CONTAINER ID   IMAGE                 COMMAND                  CREATED       STATUS       PORTS
                    NAMES
a0c268c14b94   jenkins/jenkins:lts   "/sbin/tini -- /usr/…"   4 hours ago   Up 4 hours   0.0.0.0:8080->8080/tcp, 0.0.0.0

The dashboard is launching, but things have started to fail.

This part of the command I ran before appears to have failed

-v /home/jenkins:/var/jenkins_home \

from

docker run \
 -u jenkins \
 --rm \
 -d \
 -p 8080:8080 \
 -p 50000:50000 \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /home/jenkins:/var/jenkins_home \
 jenkins/jenkins:lts 

because when I try to run the script in the tutorial, it fails.

+ /home/jenkins/scripts/fibonacci.sh 5 /var/jenkins_home/workspace/script@tmp/durable-14129c06/script.sh: 1: /var/jenkins_home/workspace/script@tmp/durable-14129c06/script.sh: /home/jenkins/scripts/fibonacci.sh: not found

There is no /var/jenkins_home folder

jenkins:~$ cd /var
jenkins:/var$ ls
backups  cache  crash  lib  local  lock  log  mail  opt  run  snap  spool  tmp

Any suggestions appreciated...

Reply all
Reply to author
Forward
Message has been deleted
0 new messages