I’m having the issue that Docker containers don’t get an IPv6 address assigned and therefore are unable to connect to IPv6-only hosts.
I was able to solve this issue for regular Docker containers (started with docker run
) by adding a file /etc/docker/daemon.json
with this contents:
{
"ipv6": true,
"fixed-cidr-v6": "fd00:ffff::/80",
"ip6tables": true,
"experimental": true
}
But apparently this isn’t enough for containers that are started by Docker Compose. I found that adding
networks:
default:
enable_ipv6: true
ipam:
config:
- subnet: fd00:1:1:1:1::/80
to docker-compose.yml
fixes the issue.
Unfortunately this requires me to edit docker-compose.yml
for each service I’m running and often those are managed by the vendor through Git, so every time I update the software I have to make sure I keep the modification in docker-compose.yml
.
Is there a way to configure Docker so that containers started by Docker Compose get an IPv6 address without modifying docker-compose.yml
?
2