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

Detect IPv6 support in containers, generate '/etc/hosts' accordingly. #47062

Merged
merged 2 commits into from
Jan 29, 2024

Commits on Jan 19, 2024

  1. daemon: set libnetwork sandbox key w/o OCI hook

    Signed-off-by: Cory Snider <csnider@mirantis.com>
    corhere authored and robmry committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    0046b16 View commit details
    Browse the repository at this point in the history
  2. Detect IPv6 support in containers.

    Some configuration in a container depends on whether it has support for
    IPv6 (including default entries for '::1' etc in '/etc/hosts').
    
    Before this change, the container's support for IPv6 was determined by
    whether it was connected to any IPv6-enabled networks. But, that can
    change over time, it isn't a property of the container itself.
    
    So, instead, detect IPv6 support by looking for '::1' on the container's
    loopback interface. It will not be present if the kernel does not have
    IPv6 support, or the user has disabled it in new namespaces by other
    means.
    
    Once IPv6 support has been determined for the container, its '/etc/hosts'
    is re-generated accordingly.
    
    The daemon no longer disables IPv6 on all interfaces during initialisation.
    It now disables IPv6 only for interfaces that have not been assigned an
    IPv6 address. (But, even if IPv6 is disabled for the container using the
    sysctl 'net.ipv6.conf.all.disable_ipv6=1', interfaces connected to IPv6
    networks still get IPv6 addresses that appear in the internal DNS. There's
    more to-do!)
    
    Signed-off-by: Rob Murray <rob.murray@docker.com>
    robmry committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    a8f7c5e View commit details
    Browse the repository at this point in the history