Skip to content

Running docker container has no ipAddress #632

@mesudip

Description

@mesudip
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Connecting a container to a network it's already connect should do nothing.

Actual behavior

It does something weird and removes the IPAddress of the container in that network.

  • restarting the container solves the issue.

Steps to reproduce the behavior

sudip@Linux-Mint:~$ docker network create --driver overlay --attachable docker
sudip@Linux-Mint:~$ docker run -d --name docker alpine sleep 5m
sudip@Linux-Mint:~$ docker network connect docker docker
sudip@Linux-Mint:~$ docker container inspect docker | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "10.0.2.8",
sudip@Linux-Mint:~$ docker network connect docker docker
Error response from daemon: endpoint with name docker already exists in network docker
sudip@Linux-Mint:~$ docker container inspect docker | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "",
sudip@Linux-Mint:~$ docker restart docker
docker
sudip@Linux-Mint:~$ docker container inspect docker | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "10.0.2.8",

Output of docker version:

Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:35:31 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:02:44 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

Containers: 11
 Running: 6
 Paused: 0
 Stopped: 5
Images: 323
Server Version: 18.09.1
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 macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
 NodeID: o1ueyyf01njcs1pi14ud1yqqf
 Is Manager: true
 ClusterID: adngjwcxr5w5rky9lcu1r7lzu
 Managers: 1
 Nodes: 1
 Default Address Pool: 10.0.0.0/8  
 SubnetSize: 24
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.1.139
 Manager Addresses:
  192.168.1.139:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 96ec2177ae841256168fcf76954f7177af9446eb
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-20-generic
Operating System: Linux Mint 19
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.42GiB
Name: Linux-Mint
ID: CXCB:6FON:JOCL:CREP:ROLV:5PLY:HU7U:WVD2:SQ3Z:B6EU:MOTX:HCL3
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions