I'm trying to start a jenkinsci/blueocean
container under Windows 10 Pro (latest). I'm running a script:
docker run ^
--rm ^
-u root ^
-d ^
-p 8080:8080 ^
-p 50000:50000 ^
-v D:/docker/jenkins/volumes/jenkins-data:/var/jenkins_home ^
-v D:/docker/jenkins/volumes/docker.sock:/var/run/docker.sock ^
-v D:/docker/jenkins/volumes/home:/home ^
jenkinsci/blueocean
This fails with the following message:
docker: Error response from daemon:
driver failed programming external connectivity on endpoint elastic_kare:
Error starting userland proxy:
Bind for 0.0.0.0:50000: unexpected error Permission denied
If I leave out the binding of port 50000 it works fine, but I need the 50000 port to communicate with the slaves on the host.
Binding 50000 to another port doesn't help. The port is not in use, according to netstat -an
. Trying to run the script as Administrator didn't help.
What could be the issue here?
update: I restarted my laptop and updated Docker Desktop to the latest version as well.
update2: after restarting laptop I restarten Docker (several times) as well. To no avail.
update3: shutting down the Windows Firewall did not solve the problem.
Fix 1: Run all the docker commands with sudo If you have sudo access on your system, you may run each docker command with sudo and you won't see this 'Got permission denied while trying to connect to the Docker daemon socket' anymore.
Docker containers can connect to the outside world without further configuration, but the outside world cannot connect to Docker containers by default.
Map TCP port 80 in the container to port 8080 on the Docker host for connections to host IP 192.168.1.100. Map UDP port 80 in the container to port 8080 on the Docker host. Map TCP port 80 in the container to TCP port 8080 on the Docker host, and map UDP port 80 in the container to UDP port 8080 on the Docker host.
If you're running Docker on Windows then it will be using Hyper-V - I've found that Hyper-V reserves a bunch of ports - you can find out by running this:
netsh interface ipv4 show excludedportrange protocol=tcp
On my machine I could see it had reserved port 50000. To free this port up I disabled Hyper-V:
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
After the reboots, I reserved port 50000:
netsh int ipv4 add excludedportrange protocol=tcp startport=50000 numberofports=1
Then enabled Hyper-V again:
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
When it came back up I could run Jenkins in Docker on Windows:
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With