Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable_ipv6 not recognised from version 3.0 #4958

Closed
asirinelli opened this issue Jun 25, 2017 · 17 comments
Closed

enable_ipv6 not recognised from version 3.0 #4958

asirinelli opened this issue Jun 25, 2017 · 17 comments

Comments

@asirinelli
Copy link

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
@shin-
Copy link

shin- commented Jun 27, 2017

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

@jorhett
Copy link

jorhett commented Jul 2, 2017

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

@shin-
Copy link

shin- commented Jul 5, 2017

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

@valentin2105
Copy link

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.

@shin-
Copy link

shin- commented Jul 18, 2017

I explained this in the comment above: #4958 (comment)

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)

@valentin2105
Copy link

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

@shin-
Copy link

shin- commented Jul 18, 2017

Down the line, yes, that is the expectation.

@project0
Copy link

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?

@ricardo-rod
Copy link

ricardo-rod commented Mar 24, 2019

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

@setsevireon
Copy link

setsevireon commented Aug 8, 2019

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.

@widlarizer
Copy link

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

marten-seemann added a commit to quic-interop/quic-interop-runner that referenced this issue Oct 14, 2020
v3 doesn't support IPv6 apparently, see
docker/compose#4958.
marten-seemann added a commit to quic-interop/quic-interop-runner that referenced this issue Oct 14, 2020
v3 doesn't support IPv6 apparently, see
docker/compose#4958.
@mietzen
Copy link

mietzen commented Feb 15, 2021

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.

This should be in the official documentation! https://docs.docker.com/compose/compose-file/compose-file-v3/#ipv4_address-ipv6_address

@sjlongland
Copy link

Just hit this today… we have a test suite that's used for testing, amongst other things, 6LoWPAN devices.

6LowPAN devices run IPv6. Not IPv4. NAT64 is useless when the "cloud side" application needs to make an unsolicited request to a mesh-side device.

Below is my work-around to the problem… specifying version: '2' wasn't sufficient as it was previously, I had to say version 2.1. (Maybe 2.0 works, I didn't try.)

$ git log -1 -p
commit 247da65990b77fa41c555998d4b6cfb6b213dcd3 (HEAD -> …branchname…)
Author: Stuart Longland <…>
Date:   Fri Feb 4 09:34:20 2022 +1000

    …: kitchen sink: Work-around `compose` breakage
    
    https://github.com/docker/compose/issues/4958
    
    Yeah… IPv6 is 20 years old, and we still apparently live in the 32-bit
    world defined by RFC-791!

diff --git a/…/docker-compose.yml b/…/docker-compose.yml
index a2142c2e..b34aaa8b 100644
--- a/…/docker-compose.yml
+++ b/…/docker-compose.yml
@@ -21,7 +21,7 @@
 # Copyright (c) WideSky.Cloud 2021
 #
 
-version: '2'
+version: '2.1'
 
 networks:
   # The WideSky Hub firmware is pre-programmed to talk to services in

usha-mandya added a commit to docker/docs that referenced this issue Feb 4, 2022
* Update ipv6 instructions for 3.x Compose files

IPv6 instructions on docker/compose#4958, are compatible with Docker Compose 3.x

* Update code block to use yaml syntax

With @usha-mandya

Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>

* Update text about using IPv6

By @usha-mandya

Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>

Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>
@bscottm
Copy link

bscottm commented Mar 16, 2022

Alternatively, you can docker network create an external network and reference it in the docker-compose.yml networks section as external. It just isn't as automagic with docker-compose 2 files. It does work and you don't have to disable the entirety of IPv6 support.

@Chaz6
Copy link

Chaz6 commented Dec 25, 2022

Is enable_ipv6 ever likely to be re-introduced into docker-compose v3? There has been no update for nearly a year now.

@Hugo54x
Copy link

Hugo54x commented Jan 24, 2023

it is kind of difficult to develop with a dual stack lite configuration. you can use e.g. a cloudflare dns entry to resolve the problem with daily changing ip addresses but ipv6 is crucial due to the fact that your ipv4 address is not available from the public...

also the documentation has to be updated. it uses a global scope ipv6 address instead unique local scope ip address range. global ipv6 address assignment should be resolved with slaac

@project0
Copy link

project0 commented Jan 24, 2023

I believe with the latest generic compose-file spec (and updated docker-compose) it should be supported again, please note that the latest spec has no version field anymore.
https://github.com/compose-spec/compose-spec/blob/master/spec.md
https://docs.docker.com/compose/compose-file/
https://docs.docker.com/compose/compose-file/compose-versioning/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests