Compose: enable_ipv6 not recognised from version 3.0

Created on 25 Jun 2017  路  11Comments  路  Source: docker/compose

It is not possible to have the enable_ipv6 directive in the composer file if version is 3.0 or higher. This is not consistent with the documentation (https://docs.docker.com/compose/compose-file/).

To be more precise, here is the docker-compose.yml file I am trying to run:

version: '2.2'

services:
  app:
    image: busybox
    command: ifconfig
    networks:
      app_net:
        ipv4_address: 172.16.238.10
        ipv6_address: fc00::10

networks:
  app_net:
    driver: bridge
    enable_ipv6: true
    ipam:
      driver: default
      config:
      - subnet: 172.16.238.0/24
      - subnet: fc00::/64

It runs very well with docker-compose up and the ipv6 address is affected to the container.

If I change the compose file to version 3.0, 3.1, 3.2 or 3.3, receive the following error:

$ docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
networks.app_net value Additional properties are not allowed ('enable_ipv6' was unexpected)

Is this an error in the documentation or in docker-compose?

For information:

$ docker-compose version
docker-compose version 1.14.0, build c7bdf9e
docker-py version: 2.3.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t  3 May 2016
$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:03 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:03 2017
 OS/Arch:      linux/amd64
 Experimental: false
formav3 kinquestion

Most helpful comment

I understand why 3.x does not provide ipv6 capabilities, but why this ticket has been closed? Does this more depends on docker swarm project? If yes, is there a another ticket to track this issue?
Ipv6 spec is roughly 20 years old and we are still not able to use it without fearing that software will not support it anymore, really?

All 11 comments

Not a bug. Network configuration in v3 is currently more limited until Swarm mode is able to support more advanced configurations.

@shin well then it's a documentation bug, no?

@jorhett It looks like it is, yes! Feel free to create an issue (or even better, submit a PR) on the docs repo!

Any question about this,

So it's not possible anymore to use IPv6 with Docker-compose > 2.1 (3, 3.1, 3.2) ?

Why ?

I have a working 2.1 compose with IPv6 setting for each containers who doesn't work anymore on new compose's version.

I explained this in the comment above: https://github.com/docker/compose/issues/4958#issuecomment-311466816

Version 3 should be considered a sidegrade of version 2 for the time being (as both will continue to evolve and be maintained for the foreseeable future)

Ok, so we can hope a new version which support IPv6 like 2.1 in newer releases ?
Thanks @shin-

Down the line, yes, that is the expectation.

I understand why 3.x does not provide ipv6 capabilities, but why this ticket has been closed? Does this more depends on docker swarm project? If yes, is there a another ticket to track this issue?
Ipv6 spec is roughly 20 years old and we are still not able to use it without fearing that software will not support it anymore, really?

Up to this date, the problem with version 3 and latest continues, now I have to inform that in version 2.3 the enable_ipv6 is working, but if you want a workaround for the 3.0 and latest versions, here we go, I do not know if there is a security issue with this.

You must comment enable_ipv6: true, and let defined all the others parameters as the documentation says, because is working as expected.
after you issue
$ sudo docker-comopose build

$ docker network create --driver bridge --ipv6 --subnet fd15:555::/64 --subnet 172.16.238.0/24 containerName-dockerfile_app_net --attachable
and then execute this and everything will work as expected until you hit swarm.
$ sudo docker-compose up -d

My workaround was editing _/etc/docker/daemon.json_ to contain

{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}

reload the docker daemon and edit _docker-compose.yml_ to contain

    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0

under the service.

Three years later, the documentation error persists. Also in [[https://mailcow.github.io/mailcow-dockerized-docs/firststeps-disable_ipv6/]]

Was this page helpful?
0 / 5 - 0 ratings