Can't start container when I use --publish argument. Getting an error with failed to start docker-proxy
If I try to run a container and use the --publish argument I do get following error: docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint nextcloud-aio-mastercontainer (f80ac1d079ef11d3d09ddd92aa60f4bd57db28713d280b18b990b4036194a0e2): failed to start userland proxy for port mapping 0.0.0.0:80:172.17.0.2:80/tcp: failed to start docker-proxy, check that the current version is in your $PATH
This is true for different ports, not just 80. If I use the --network host I can run the container.
So somehow my bridge network is broken. Tried to create a new bridge network, but same issue.
I could not find any post on google to that error message. Can someone help me?
Thanks, Furkan
Can anyone help me here? I can provide more data if needed :)
Hey @thespirit61 are you using Docker Desktop?
I've also come across this and will try direct to the relevant people.
Have you tried completely re-installing Docker?
Hello @Benehiko ,
no I am not running Docker Desktop at all. Yes I tried to re-install Docker, didn't work for me.
My solution was to downgrade the docker version, which solved the problem. So somehow the newest release of my Docker version broke something.
Hi @thespirit61 - the important part of the error message is failed to start docker-proxy, check that the current version is in your $PATH ...
The moby 28.x version of the docker-proxy binary takes an extra argument that older versions won't understand. I think your dockerd is probably running with a $PATH that picks up an older version?
You can check the version of a docker-proxy binary like this ...
# docker-proxy --version
docker-proxy (commit bbd0a17) version 28.0.1
If you can't find an older version, or it's not clear what PATH the daemon is running with - you could try adding the correct path to your /etc/docker/daemon.json config file. Something like this, but with the path to the docker-proxy installed with version 28.x (which might be /usr/bin/docker-proxy) ...
"userland-proxy-path": "/path/to/my/docker-proxy"
Hopefully that'll sort things out - but, do let us know.
Hey @robmry , many many thanks for your detailed answer. I did read about the moby thing in some other Reddit post. I am just confused, should that not be updated automatically wiht the docker package itself? Or do you think this is just some error happening on my side? I will try why you did suggested and see how it goes.
Yes, the new version of docker-proxy would normally be installed along with dockerd (although you've not mentioned what OS you're using, or how you installed docker).
But, even if the new docker-proxy was installed, perhaps there's an old version of docker on your host and its docker-proxy is getting picked up from the $PATH instead of the new one.
Update: After updating my docker engine I got the same error. Did run: docker-proxy --version and could see that it is showing me a version with 27.x Did run: /usr/bin/docker-proxy --version and could see the version 28.x
Did run: which docker-proxy and deleted the file it showed me (/usr/local/bin/docker-proxy)
After restart of the machine, the containers did start successfully. Thanks for your help here @robmry !
By the way I am running a Debian 12 here.
Great! Thank you for the update.