From b730e42610b038f938fa4f43da564127b6609d29 Mon Sep 17 00:00:00 2001 From: "Kayla Reopelle (she/her)" <87386821+kaylareopelle@users.noreply.github.com> Date: Fri, 4 Feb 2022 06:03:19 -0800 Subject: [PATCH] Update ipv6 instructions for 3.x Compose files (#14168) * Update ipv6 instructions for 3.x Compose files IPv6 instructions on https://github.com/docker/compose/issues/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> --- compose/compose-file/compose-file-v3.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/compose/compose-file/compose-file-v3.md b/compose/compose-file/compose-file-v3.md index 9c92c5244a..49e34b0267 100644 --- a/compose/compose-file/compose-file-v3.md +++ b/compose/compose-file/compose-file-v3.md @@ -1592,8 +1592,18 @@ The corresponding network configuration in the [top-level networks section](#network-configuration-reference) must have an `ipam` block with subnet configurations covering each static address. -> If IPv6 addressing is desired, the [`enable_ipv6`](compose-file-v2.md#enable_ipv6) -> option must be set, and you must use a [version 2.x Compose file](compose-file-v2.md#ipv4_address-ipv6_address). +If you'd like to use IPv6, you must first ensure that the Docker daemon is configured to support IPv6. See [Enable IPv6](../../config/daemon/ipv6.md) for detailed instructions. You can then access IPv6 addressing in a version 3.x Compose file by editing the `/etc/docker/daemon.json` to contain: +`{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}` + +Then, reload the docker daemon and edit docker-compose.yml to contain the following under the service: + +```yaml + sysctls: + - net.ipv6.conf.all.disable_ipv6=0 +``` + +> The [`enable_ipv6`](compose-file-v2.md#enable_ipv6) +> option is only available in a [version 2.x Compose file](compose-file-v2.md#ipv4_address-ipv6_address). > _IPv6 options do not currently work in swarm mode_. An example: