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

docs: fix ipv6 example for Compose #3531

Merged

Conversation

milas
Copy link
Contributor

@milas milas commented Sep 7, 2023

Description

Fix the example for Docker Compose to configure an IPv6 network.

This was unfortunately slightly incorrect due to a mistake in the official Docker docs being propagated, which has been fixed upstream with docker/docs#18119.

The subnet must be specified as part of ipam.config.

Refer to the official Compose Spec for more details:

Type of change

  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This was unfortunately slightly incorrect due to a mistake in the
official Docker docs being propagated, which has been fixed upstream
with docker/docs#18119.

The subnet must be specified as part of `ipam.configs`.

Refer to the official Compose Spec for more details:
 * https://docs.docker.com/compose/compose-file/06-networks/#ipam
@milas
Copy link
Contributor Author

milas commented Sep 7, 2023

For context, with Compose v2.21.0:

services:
  whoami:
    image: traefik/whoami
    networks: [ip6net]
    ports:
      - 7654:80

networks:
  ip6net:
    enable_ipv6: true
    subnet: 2001:0DB8::/112
❯ docker compose up --wait
validating /Users/milas/.../compose.yaml: networks.ip6net Additional property subnet is not allowed

⬇️

services:
  whoami:
    image: traefik/whoami
    networks: [ip6net]
    ports:
      - 7654:80

networks:
  ip6net:
    enable_ipv6: true
    ipam:
      config:
        - subnet: 2001:0DB8::/112
❯ docker compose up --wait
[+] Running 2/2
 ✔ Network ipv6_ip6net      Created
 ✔ Container ipv6-whoami-1  Healthy

❯ curl 'http://[::1]:7654'
Hostname: 2174081f7fab
IP: 127.0.0.1
IP: ::1
IP: 172.20.0.2
IP: 2001:db8::2                      <--- ✨ 
IP: fe80::42:acff:fe14:2
RemoteAddr: 192.168.65.1:36722
GET / HTTP/1.1
Host: [::1]:7654
User-Agent: curl/8.1.2
Accept: */*

Copy link
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had verified this in the past that as working but I must have been mistaken 😬

Thanks so much for letting us know about this! ❤️

@polarathene polarathene added area/documentation kind/bug/fix A fix (PR) for a confirmed bug labels Sep 7, 2023
@polarathene polarathene added this to the v13.0.0 milestone Sep 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Documentation preview for this PR is ready! 🎉

Built with commit: 5762703

@polarathene polarathene merged commit 2024169 into docker-mailserver:master Sep 7, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation kind/bug/fix A fix (PR) for a confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants