Closed JamesWhitlock closed 5 years ago
Unfortunately I have no access to a Windows computer however I found this https://docs.docker.com/docker-for-windows/networking/ you may can play around with some settings.
Can you resolve host.docker.internal from within docker container?
The issue is occuring within a virtualised boot2docker inside VirtualBox so should not be aware of the fact it is running on a windows host.
host.docker.internal does not resolve but it appears to find the gateway correctly 172.17.0.1
I'm not very au fait with iptables but it appears the problem is iptables can't find 'multiport'.
Which virtual box base image do you use?
On Mon, 5 Aug 2019, 11:33 JamesWhitlock, notifications@github.com wrote:
The issue is occuring within a virtualised boot2docker inside VirtualBox so should not be aware of the fact it is running on a windows host.
host.docker.internal does not resolve but it appears to find the gateway correctly 172.17.0.1
I'm not very au fait with iptables but it appears the problem is iptables can't find 'multiport'.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/qoomon/docker-host/issues/23?email_source=notifications&email_token=AA6HUATDCYF4QAZLLGPCVXTQC7XX3A5CNFSM4II6SUYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3RIDZA#issuecomment-518160868, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6HUAQTUHBDX6UY5VATKCDQC7XX3ANCNFSM4II6SUYA .
May you can post the output of cat /proc/net/ip_tables_matches ?
Docker toolbox uses boot2docker under the hood which is supplied with docker toolbox. Version my version is shipped with is https://github.com/boot2docker/boot2docker/releases/download/v18.09.3/boot2docker.iso
/ # cat /proc/net/ip_tables_matches addrtype conntrack conntrack conntrack state addrtype icmp policy udplite udp tcp
Well as you already figured out, it's because of the missing multiport module.
Maybe I can install it? or implement a fallback for single nat rules.
I think I found a way. WDYT
for forwarding_port in $(echo "$FORWARDING_PORTS" | tr ";" " ")
do
iptables --table nat --insert PREROUTING --protocol tcp \
--dport "$forwarding_port" --jump DNAT --to-destination $DOCKER_HOST
iptables --table nat --insert PREROUTING --protocol udp \
--dport "$forwarding_port" --jump DNAT --to-destination $DOCKER_HOST
done
just release version 2.3.0
Great, it seems to be working. Thank you.
Glad to hear that.
I'm trying to run this on Docker Toolbox v18.09.3 on Windows but am unable to get the image to boot successfully. I've struggling to debug this, would you be able to advise how I might debug this further?
I start the container:
And docker ps reports the container is constantly restarting. Docker logs reports:
Disabling the entrypoint and attaching, I found the first call to iptables fails
Appears tables are empty: