1
0
mirror of https://github.com/docker/cli.git synced 2026-01-22 03:22:01 +03:00
Files
cli/components/engine/daemon
Ahmet Alp Balkan b07ebd0f2f Add containers’ networks to /containers/json
After addition of multi-host networking in Docker 1.9, Docker Remote
API is still returning only the network specified during creation
of the container in the “List Containers” (`/containers/json`) endpoint:

    ...
    "HostConfig": {
      "NetworkMode": "default"
    },

The list of networks containers are attached to is only available at
Get Container (`/containers/<id>/json`) endpoint.
This does not allow applications utilizing multi-host networking to
be built on top of Docker Remote API.

Therefore I added a simple `"NetworkSettings"` section to the
`/containers/json` endpoint. This is not identical to the NetworkSettings
returned in Get Container (`/containers/<id>/json`) endpoint. It only
contains a single field `"Networks"`, which is essentially the same
value shown in inspect output of a container.

This change adds the following section to the `/containers/json`:

    "NetworkSettings": {
      "Networks": {
        "bridge": {
          "EndpointID": "2cdc4edb1ded3631c81f57966563e...",
          "Gateway": "172.17.0.1",
          "IPAddress": "172.17.0.2",
          "IPPrefixLen": 16,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:ac:11:00:02"
        }
      }
    }

This is of type `SummaryNetworkSettings` type, a minimal version of
`api/types#NetworkSettings`.

Actually all I need is the network name and the IPAddress fields. If folks
find this addition too big, I can create a `SummaryEndpointSettings` field
as well, containing just the IPAddress field.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 755f8609f699a20cb47ec7269e3a9469541a9419
Component: engine
2015-12-14 19:03:23 -08:00
..
2015-12-02 16:43:49 -05:00
2015-07-29 23:39:18 +02:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-11-05 17:09:57 -05:00
2015-12-03 16:30:44 -08:00
2015-08-27 22:07:42 -07:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-02 11:12:42 -05:00
2015-12-01 19:53:49 -08:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00
2015-12-03 17:39:49 +01:00

This directory contains code pertaining to running containers and storing images

Code pertaining to running containers:

  • execdriver

Code pertaining to storing images:

  • graphdriver