Docker Community Forums

Share and learn in the Docker community.

Compose does not create default networks anymore upon enabling IPv6

Hi,

I’ve enabled IPv6 by creating /etc/docker/daemon.json with:

{
  "ipv6": true,
  "fixed-cidr-v6": "fd00:0:0:0:17::/80"
}

Upon restart, the docker interface reflects according.

docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:da:12:72:54 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fd00::17:0:0:1/80 scope global
valid_lft forever preferred_lft forever
inet6 fe80::42:daff:fe12:7254/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::1/64 scope link
valid_lft forever preferred_lft forever

Yet, upon executing a stack from within portainer (compose version 2), the associated container network isn’t being created anymore.

Is the only option to create the container network manually, followed by joining the containers once IPv6 is enabled ?

It turns out this is indeed a docker-compose bug that is going to be fixed in 1.9.0.

Meanwhile, there is a workaround by creating a custom network with the docker network command:

docker network create --subnet=172.16.2.0/24 --gateway=172.16.2.1 --ipv6 --subnet=<myV6Network/subnet> dockerbridge
… which can then be made available inside docker-composed.yml by writing

networks:
dockerbridge:
external:
name: dockerbridge