So, I’m trying to run Jenkins via Docker with:
docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
but getting:
1 |
docker: Error response from daemon: driver failed programming external connectivity on endpoint musing_yalow (1fb0749ac2a8e9624a1b01aef22125819a89183eb9f89ee8ba112295e2b29dce): Bind for 0.0.0.0:8080 failed: port is already allocated. |
Clearly the previous time I ran Jenkins the container hadn’t been cleanly stopped. Or there was another container using that port (it turned out to be the latter).
Here’s how to fix it.
- check port:
netstat -nl -p tcp | grep 8080
(interestingly this didn’t show anything even though: docker ps
(showed a container using this port)
docker stop <container name>
to solve the problem.