Jenkins localtest

Hello Community,

I was following the docker lectures, specifically demo-advanced-docker-run-features. I ran jenkins container on my wsl and tried to access (http://172.17.0.2:8080/ )but i got “This site can’t be reached” page. But I could able to access http://localhost:8080/

docker run -d --name jenkinstest -p 8080:8080 jenkins/jenkins

Can someone help on this what I have missed or anything to add. I am not able to understand this part from session. :pray::pray::pray:

This is expected behaviour. Docker containers, by default, run in their own isolated network.
When you run a container, Docker assigns it an IP address in this private network (like 172.17.0.2 in your case). This IP address is only reachable from within the Docker host, not from your local network or the internet. So that is why you need to forward the port (-p) to access Jenkins.

Thanks for the info, is there any other way I could access this in as my local network like shown in training session!!!