Issue
I am newbie in docker,noticed below command while referring a document to install jenkins in docker.
docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins
Solution
-p <source>:<dest>
or --publish <source>:<dest>
, create a forwarding rule from your <docker-host>:<source>
to <container>:<dest>
.
If used multiple times, it creates multiple forwarding rules.
In your example, the traffic from <host-machine-IP-addr>:8080
, is forwarded inside the Jenkins container, to the service that's is listening on :8080
.
Exactly the same thing is happening with port :50000
.
Basically the container's Jenkins web UI is exposed on the host machine on 8080, while the Jenkins slave port is also exposed on you host machine on 50000.
Answered By - Neo Anderson