Maybe something got fixed in beta10, I can now access the ip address docker-ipv4
from within docker and published ports are available there.
$ docker run -d -p 9999:80 httpd
$ pinata list | grep 'docker-ipv4='
* network = hostnet (docker-ipv4=192.168.65.2, host-ipv4=192.168.65.1)
$ docker run centos curl -fsSI http://192.168.65.2:9999
HTTP/1.1 200 OK
So, I can start a apt-cacher-ng container and my Dockerfile’s can access it at http://192.168.65.2:3142. I’m setting the actual ip using --build-arg
. This is good because that ip doesn’t change when I change wifi / networks.