Docker Community Forums

Share and learn in the Docker community.

Connecting to Jenkins service running in local docker


(Jaff) #1

Running Version 17.06.2-ce-mac27 (19124) on MacOS X 10.11.6

My command is docker run --rm -it -v /Users/mjaffe/source_dir:/build jenkins:2.60.2 /bin/bash where my source_dir contains a Jenkinsfile and Dockerfile I am testing. According to docker ps I am exposing the port, but my host browser does not connect to http://localhost:8080/

What am I doing wrong?


(Andreas Krebs) #2

Exposing the port isn’t enough, you also have to publish it (basically does a port forwarding from your host to the container) with the -p switch.

docker run --rm -it -p 8080:8080 -v /Users/mjaffe/source_dir:/build jenkins:2.60.2 /bin/bash