locked
How do I get my container's (transparent driver) IP address without entering it or looking at DHCP components? RRS feed

  • Question

  • So, I created a network tied to the transparent driver with no additional relevant parameters. According to the [documentation] IP assignment will be handled via DHCP. I've verified via my router that this works and my container is accessible on the physical network.

    But how do I get this information from docker? Various inspect commands return null/0.0.0.0 information.

    [docker version]:

    Client: Version: 17.06.0-dev API version: 1.27 (downgraded from 1.30) Go version: go1.8.1 Git commit: 61c0b9f Built: Wed May 24 18:34:23 2017 OS/Arch: windows/amd64 Server: Version: 17.03.1-ee-3 API version: 1.27 (minimum version 1.24) Go version: go1.7.5 Git commit: 3fcee33 Built: Thu Mar 30 19:31:22 2017 OS/Arch: windows/amd64 Experimental: true

    [docker info]:

    Containers: 4
     Running: 1
     Paused: 0
     Stopped: 3
    Images: 8
    Server Version: 17.03.1-ee-3
    Storage Driver: windowsfilter
     Windows:
    Logging Driver: json-file
    Plugins:
     Volume: local
     Network: l2bridge l2tunnel nat null overlay transparent
     Log:
    Swarm: inactive
    Default Isolation: process
    Kernel Version: 10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)
    Operating System: Windows Server 2016 Standard
    OSType: windows
    Architecture: x86_64
    CPUs: 8
    Total Memory: 31.95GiB
    Name: [redacted]
    ID: [redacted]
    Docker Root Dir: C:\ProgramData\Docker
    Debug Mode (client): false
    Debug Mode (server): true
     File Descriptors: -1
     Goroutines: 24
     System Time: 2017-05-27T18:08:06.4823076-07:00
     EventsListeners: 0
    Username: withinrafael
    Registry: https://index.docker.io/v1/
    Experimental: true
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    [docker inspect <container>] shows:

    "NetworkSettings": {
      "Bridge": "",
      "SandboxID": "[redacted]",
      "HairpinMode": false,
      "LinkLocalIPv6Address": "",
      "LinkLocalIPv6PrefixLen": 0,
      "Ports": {
          "12345/tcp": null,
      },
      "SandboxKey": "[redacted]",
      "SecondaryIPAddresses": null,
      "SecondaryIPv6Addresses": null,
      "EndpointID": "",
      "Gateway": "",
      "GlobalIPv6Address": "",
      "GlobalIPv6PrefixLen": 0,
      "IPAddress": "",
      "IPPrefixLen": 0,
      "IPv6Gateway": "",
      "MacAddress": "",
      "Networks": {
          "external": {
              "IPAMConfig": null,
              "Links": null,
              "Aliases": [
                  "[redacted]"
              ],
              "NetworkID": "193afcd8c79372caef5d351825c8aa9741b04b8856ed78df0cbeb1ad8bc8f23d",
              "EndpointID": "[redacted]",
              "Gateway": "",
              "IPAddress": "",
              "IPPrefixLen": 0,
              "IPv6Gateway": "",
              "GlobalIPv6Address": "",
              "GlobalIPv6PrefixLen": 0,
              "MacAddress": "[redacted]"
          }
      }
    }

    [docker network inspect <transparent network name>] shows:

    [
      {
        "Name": "external",
        "Id": "193afcd8c79372caef5d351825c8aa9741b04b8856ed78df0cbeb1ad8bc8f23d",
        "Created": "2017-05-27T11:34:52.7362288-07:00",
        "Scope": "local",
        "Driver": "transparent",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "windows",
            "Options": {},
            "Config": [
                {
                    "Subnet": "0.0.0.0/0",
                    "Gateway": "0.0.0.0"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Containers": {
            "464bd9cb0cac826ce8f9ef3d680e1079ddf21c97f2edbc7b0da5ba2386d58877": {
                "Name": "frosty_kirch",
                "EndpointID": "77e6276eb84d7eb1e4a8dd7d9edeff16ec1218d58e90997ffe375ebdf4a672ed",
                "MacAddress": "00:15:5d:7b:d8:7d",
                "IPv4Address": "",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.windowsshim.hnsid": "3fe2df0b-1eeb-4dd9-856a-a73ccc40f1c5"
        },
        "Labels": {}
      }
    ]






    Sunday, May 28, 2017 1:06 AM

All replies