Reputation:
I'm on a Windows laptop.
I have Oracle VM VirtualBox installed and Docker installed.
I'm using the Docker Quick Start Terminal
Docker comes up as follows
```Copying certs to the remote machine... Setting Docker configuration on the remote daemon...
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100 For help getting started, check out the docs at https://docs.docker.com
Start interactive shell```
I run Jenkins, docker run -d -it -p 8080:8080 jenkins/jenkins:lts
But I can't figure out how to "bridge" so I can access Jenkins from the browser.
The virtual machine is, 192.168.99.100 and the Jenkins container is 172.17.0.2
Upvotes: 1
Views: 4670
Reputation: 11
The answer is you should be able to access the Jenkins from windows using this url http://192.168.99.100:8080.
Here is the explanation.
you have already exposed the docker containers port. so you should be accessing Jenkins via the Linux VM port 8080. you can test that by triggering telnet localhost 8080 on the linux VM terminal
To access it from windows, you access it through the linux VM ip : 8080
But first, you need to make sure that your host machine can ping the VM.
In case your VM uses Nat network, then you would need to set up port forwarding mapping the 8080 port of the VM to a local port on your host machine and then accessing the jenkins from that port.
Upvotes: 1
Reputation: 807
Have you tried Docker for Windows? It enables accessing ports exposed as you did by using localhost
without needing to worry about what the VirtualBox VM is doing.
Upvotes: 1