docker / for-linux

Docker Engine for Linux
https://docs.docker.com/engine/installation/
754 stars 85 forks source link

IPv6: ADDRCONF(NETDEV_UP): docker0: link is not ready #924

Closed bdrung closed 4 years ago

bdrung commented 4 years ago

Expected behavior

After installation and reboot, I expect the docker0 bridge device to have an IP address assigned.

Actual behavior

No IP address is assigned to the bridge device:

$ ip a show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:05:ac:1a:30 brd ff:ff:ff:ff:ff:ff

The kernel complains that the link is not ready:

$ dmesg | grep docker0 
[    9.796292] IPv6: ADDRCONF(NETDEV_UP): docker0: link is not ready

Restarting the docker daemon will solve the issue:

$ systemctl restart docker.service
$ ip a show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:05:ac:1a:30 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

Steps to reproduce the behavior

Just install docker on Ubuntu 18.04:

apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io

Then you will experience this issue.

Output of docker version:

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:22 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-76-generic
 Operating System: Ubuntu 18.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 1
 Total Memory: 973.5MiB
 Name: ubuntu
 ID: CWW4:7GCL:TGSX:HPPN:GKN7:CWQR:Q6LX:FXKE:UDRM:PTOO:5ZYR:3MA7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

This issues is reproducible in the IONOS Enterprise Cloud with a minimal Ubuntu 18.04 image. This Ubuntu 18.04 image does not contain any modifications (all packages come from Ubuntu).

stefano-gurrieri commented 4 years ago

Hi,

I've the same issue on my Linux embedded platform. Did you find any solution?

spuder commented 4 years ago

Do you have ipforwarding enabled?

cat /proc/sys/net/ipv4/ip_forward

Check dmesg | grep docker for errors.

Possibly related https://github.com/moby/moby/issues/26492

bdrung commented 4 years ago

We figured out the cause. We had this netplan configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    all:
      match:
        name: "*" 
      dhcp4: yes
      dhcp6: yes

This match also applied to docker0 causing the symptoms described in this ticket. After changing the netplan config to

network:
  version: 2
  renderer: networkd
  ethernets:
    all:
      match:
        name: "en*" 
      dhcp4: yes
      dhcp6: yes

docker starts without this issue.