Should docker run --net=host work?

In my setup, I’m still using docker toolbox for MAC (i.e. virtualbox as docker machine) and a workaround to make this behaviour happens is to establish a reverse tunnel between MAC OSX and docker-machine

ssh -t -R8000:localhost:8000 docker@$(docker-machine ip dev)

after having the tunnel opened, I can “docker run -it --rm --net=host buildpack-deps:curl curl localhost:8000” and get the desired behaviour

I know it is just a work around… but it is there… just in case it could be useful for somebody

you are welcome to try it on xhyve as well, I think it should work AS-IS

1 Like