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

Fix LinkLocalIPs in V2 #9692

Merged
merged 1 commit into from Aug 1, 2022
Merged

Fix LinkLocalIPs in V2 #9692

merged 1 commit into from Aug 1, 2022

Conversation

floatingstatic
Copy link
Contributor

Signed-off-by: Jeremiah Millay jmillay@fastly.com

What I did

As described in #9659 link_local_ips in compose yaml is no longer honored in compose V2. This change pulls in fixes in compose-go v1.3.0 that allow us set the LinkLocalIPs field in network.EndpointIPAMConfig{}.

I have validated this is working with the following compose yaml:

services:
  foo:
    image: alpine
    entrypoint: ["sleep", "infinity"]
    networks:
      default:
        ipv4_address: 10.1.0.100
        ipv6_address: 2001:db8:0:1::100
        link_local_ips:
          - fe80::1:95ff:fe20:100
networks:
  default:
    driver: bridge
    enable_ipv6: true
    ipam:
      config:
        - subnet: 10.1.0.0/16
        - subnet: 2001:db8:0:1::/64

Building the compose plugin locally with make compose-plugin we see the following:

$ bin/docker-compose -f ~/Desktop/compose.yaml up -d
$ bin/docker-compose --version
Docker Compose version v2.7.0-26-g2e7b4074
$ bin/docker-compose -f ~/Desktop/compose.yaml up -d
[+] Running 2/2
 ⠿ Network desktop_default  Created                                                                                                                                                                            0.0s
 ⠿ Container desktop-foo-1  Started                                                                                                                                                                            0.4s
$ bin/docker-compose -f ~/Desktop/compose.yaml exec foo ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
194: eth0@if195: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 state UP
    inet6 2001:db8:0:1::100/64 scope global flags 02
       valid_lft forever preferred_lft forever
    inet6 fe80::42:aff:fe01:64/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::1:95ff:fe20:100/64 scope link
       valid_lft forever preferred_lft forever

As expected we now see fe80::1:95ff:fe20:100 assigned to the container, whereas in #9659 with the same compose yaml this was not working in V2.

Related issue
Fixes #9659 after changes in compose-spec/compose-go#289

Signed-off-by: Jeremiah Millay <jmillay@fastly.com>
Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

@laurazard laurazard merged commit 57f98ef into docker:v2 Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

link_local_ips does not work in compose V2
3 participants