Tanya C
Tanya C

Reputation: 95

Jenkins container running but not accessible via host

I have installed jenkins on a VM and it is showing as up and running but not accessible via host.

Below is the command for running jenkins:

docker pull jenkins
docker run -p 9080:9080 -p 50000:50000 jenkins

I tried accessing via:

http://10.34.38.100:9080

session

That did not work though: what would be the right URL to access Jenkins?

Upvotes: 5

Views: 5066

Answers (1)

VonC
VonC

Reputation: 1323115

It depends on your VM (VMWare? VirtualBox) and host (the actual OS which has installed a VM)

IF you are using Docker for Windows, it would use the HyperV VM (Windows 10 only), and http://localhost:8080 would work.
Same idea with Docker for Mac, and its XHyve Hypervisor.

But with an actual VM, you might need to setup a port forwarding before being able to do http://localhost:8080, or to use the IP of the VM itself (for example docker-machine ip default 192.168.99.100).

And that supposes your Jenkins application publishes its port to the one you want, as commented by lvthillo: -p 9080:8080.
See docker run publish port.

Every Localhost having some IP address, So If you use docker in windows by Docker ToolBox at the Don't Check with Localhost:8080 in your browser why because that is not the actual host.Your Localhost running in Vmware so you can check your IP address by using this Command (docker-machine ip default)

For Example : I got 192.168.99.100 - using this IP to run the Jenkins like 192.168.99.100:8080

Upvotes: 2

Related Questions