Enable docker IPv6 in kokoro

We need docker IPv6 for ip6tables tests. Docker has spotty IPv6 support, so just
enabling IPv6 in daemon.json breaks the Ruby image test (AFAICT it breaks
anything that tries to use IPv6 to reach the internet). An ip6tables NAT rule is
added to handle this.

We could make these changes as part of scripts/, but these would overwrite
global values and possibly break users' systems.

PiperOrigin-RevId: 318508209
This commit is contained in:
Kevin Krakauer
2020-06-26 11:19:12 -07:00
committed by gVisor bot
parent 7fb6cc286f
commit 47ac142dc9
+11
View File
@@ -52,3 +52,14 @@ while true; do
exit $result
fi
done
# Enable Docker IPv6.
cat > /etc/docker/daemon.json <<EOF
{
"fixed-cidr-v6": "2001:db8:1::/64",
"ipv6": true
}
EOF
# Docker's IPv6 support is lacking and does not work the same way as IPv4. We
# can use NAT so containers can reach the outside world.
ip6tables -t nat -A POSTROUTING -s 2001:db8:1::/64 ! -o docker0 -j MASQUERADE