Docker supports IPv6. Starting from Docker 1.5, Docker introduced support for IPv6, enabling containers to directly utilize IPv6 addresses and networking. To enable IPv6 in Docker, you must configure the Docker daemon.
For example, to enable IPv6 in Docker, add the --ipv6 flag when starting the Docker daemon and specify a default IPv6 subnet, as shown below:
bashdockerd --ipv6 --fixed-cidr-v6="2001:db8:1::/64"
This configuration allows all Docker containers to be assigned IPv6 addresses within the 2001:db8:1::/64 subnet.
Additionally, you can enable IPv6 in specific Docker networks. For example, create a new network with IPv6 support:
bashdocker network create --ipv6 --subnet="2001:db8:2::/64" my_network
This allows containers connected to the my_network network to obtain IPv6 addresses within the 2001:db8:2::/64 subnet.
With these configurations, you can ensure Docker containers operate normally in IPv6-enabled environments, facilitating modern network deployments and meeting scenarios requiring native IPv6 communication.