Skip to content

Commit c4e1697

Browse files
author
John Howard
committed
Add isolation to info
Signed-off-by: John Howard <jhoward@microsoft.com>
1 parent 94bc2b1 commit c4e1697

File tree

8 files changed

+150
-1
lines changed

8 files changed

+150
-1
lines changed

api/types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ type Info struct {
260260
// running when the daemon is shutdown or upon daemon start if
261261
// running containers are detected
262262
LiveRestoreEnabled bool
263+
Isolation container.Isolation
263264
}
264265

265266
// PluginsInfo is a temp struct holding Plugins name

cli/command/system/info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
141141
fmt.Fprintf(dockerCli.Out(), "\n")
142142
}
143143

144+
// Isolation only has meaning on a Windows daemon.
145+
if info.OSType == "windows" {
146+
fmt.Fprintf(dockerCli.Out(), "Default Isolation: %v\n", info.Isolation)
147+
}
148+
144149
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion)
145150
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem)
146151
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "OSType: %s\n", info.OSType)

daemon/info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
118118
NoProxy: sockets.GetProxyEnv("no_proxy"),
119119
SecurityOptions: securityOptions,
120120
LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled,
121+
Isolation: daemon.defaultIsolation,
121122
}
122123

123124
// TODO Windows. Refactor this more once sysinfo is refactored into

docs/reference/api/docker_remote_api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ This section lists each version from latest to oldest. Each listing includes a
116116

117117
[Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation
118118

119+
* `GET /info` now returns `Isolation`.
119120
* `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits.
120121
* `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status.
121122
* `GET /containers/json` now accepts `removing` as a valid value for the `status` filter.

docs/reference/api/docker_remote_api_v1.25.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,7 @@ Display system-wide information
22212221
22222222
GET /info HTTP/1.1
22232223
2224-
**Example response**:
2224+
**Example response (Linux)**:
22252225
22262226
HTTP/1.1 200 OK
22272227
Content-Type: application/json
@@ -2299,6 +2299,109 @@ Display system-wide information
22992299
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
23002300
}
23012301
2302+
2303+
**Example response (Windows)**:
2304+
2305+
HTTP/1.1 200 OK
2306+
Content-Type: application/json
2307+
2308+
{
2309+
"ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62",
2310+
"Containers": 1,
2311+
"ContainersRunning": 0,
2312+
"ContainersPaused": 0,
2313+
"ContainersStopped": 1,
2314+
"Images": 17,
2315+
"Driver": "windowsfilter",
2316+
"DriverStatus": [
2317+
["Windows", ""]
2318+
],
2319+
"SystemStatus": null,
2320+
"Plugins": {
2321+
"Volume": ["local"],
2322+
"Network": ["nat", "null", "overlay"],
2323+
"Authorization": null
2324+
},
2325+
"MemoryLimit": false,
2326+
"SwapLimit": false,
2327+
"KernelMemory": false,
2328+
"CpuCfsPeriod": false,
2329+
"CpuCfsQuota": false,
2330+
"CPUShares": false,
2331+
"CPUSet": false,
2332+
"IPv4Forwarding": true,
2333+
"BridgeNfIptables": true,
2334+
"BridgeNfIp6tables": true,
2335+
"Debug": false,
2336+
"NFd": -1,
2337+
"OomKillDisable": false,
2338+
"NGoroutines": 11,
2339+
"SystemTime": "2016-09-23T11:59:58.9843533-07:00",
2340+
"LoggingDriver": "json-file",
2341+
"CgroupDriver": "",
2342+
"NEventsListener": 0,
2343+
"KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)",
2344+
"OperatingSystem": "Windows Server 2016 Datacenter",
2345+
"OSType": "windows",
2346+
"Architecture": "x86_64",
2347+
"IndexServerAddress": "https://index.docker.io/v1/",
2348+
"RegistryConfig": {
2349+
"InsecureRegistryCIDRs": ["127.0.0.0/8"],
2350+
"IndexConfigs": {
2351+
"docker.io": {
2352+
"Name": "docker.io",
2353+
"Mirrors": null,
2354+
"Secure": true,
2355+
"Official": true
2356+
}
2357+
},
2358+
"Mirrors": null
2359+
},
2360+
"NCPU": 8,
2361+
"MemTotal": 4293828608,
2362+
"DockerRootDir": "C:\\control",
2363+
"HttpProxy": "",
2364+
"HttpsProxy": "",
2365+
"NoProxy": "",
2366+
"Name": "WIN-V0V70C0LU5P",
2367+
"Labels": null,
2368+
"ExperimentalBuild": false,
2369+
"ServerVersion": "1.13.0-dev",
2370+
"ClusterStore": "",
2371+
"ClusterAdvertise": "",
2372+
"SecurityOptions": null,
2373+
"Runtimes": null,
2374+
"DefaultRuntime": "",
2375+
"Swarm": {
2376+
"NodeID": "",
2377+
"NodeAddr": "",
2378+
"LocalNodeState": "inactive",
2379+
"ControlAvailable": false,
2380+
"Error": "",
2381+
"RemoteManagers": null,
2382+
"Nodes": 0,
2383+
"Managers": 0,
2384+
"Cluster": {
2385+
"ID": "",
2386+
"Version": {},
2387+
"CreatedAt": "0001-01-01T00:00:00Z",
2388+
"UpdatedAt": "0001-01-01T00:00:00Z",
2389+
"Spec": {
2390+
"Orchestration": {},
2391+
"Raft": {
2392+
"ElectionTick": 0,
2393+
"HeartbeatTick": 0
2394+
},
2395+
"Dispatcher": {},
2396+
"CAConfig": {},
2397+
"TaskDefaults": {}
2398+
}
2399+
}
2400+
},
2401+
"LiveRestoreEnabled": false,
2402+
"Isolation": "process"
2403+
}
2404+
23022405
**Status codes**:
23032406
23042407
- **200** – no error

docs/reference/commandline/info.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,36 @@ You can also specify the output format:
154154

155155
$ docker info --format '{{json .}}'
156156
{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
157+
158+
Here is a sample output for a daemon running on Windows Server 2016:
159+
160+
E:\docker>docker info
161+
Containers: 1
162+
Running: 0
163+
Paused: 0
164+
Stopped: 1
165+
Images: 17
166+
Server Version: 1.13.0-dev
167+
Storage Driver: windowsfilter
168+
Windows:
169+
Logging Driver: json-file
170+
Plugins:
171+
Volume: local
172+
Network: nat null overlay
173+
Swarm: inactive
174+
Default Isolation: process
175+
Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)
176+
Operating System: Windows Server 2016 Datacenter
177+
OSType: windows
178+
Architecture: x86_64
179+
CPUs: 8
180+
Total Memory: 3.999 GiB
181+
Name: WIN-V0V70C0LU5P
182+
ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62
183+
Docker Root Dir: C:\control
184+
Debug Mode (client): false
185+
Debug Mode (server): false
186+
Registry: https://index.docker.io/v1/
187+
Insecure Registries:
188+
127.0.0.0/8
189+
Live Restore Enabled: false

integration-cli/docker_test_vars.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"path/filepath"
1010
"strconv"
1111

12+
"github.com/docker/docker/api/types/container"
1213
"github.com/docker/docker/pkg/reexec"
1314
)
1415

@@ -69,6 +70,9 @@ var (
6970
// Environment variable WINDOWS_BASE_IMAGE can override this
7071
WindowsBaseImage = "windowsservercore"
7172

73+
// isolation is the isolation mode of the daemon under test
74+
isolation container.Isolation
75+
7276
// daemonPid is the pid of the main test daemon
7377
daemonPid int
7478
)

integration-cli/docker_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func init() {
8484
volumesConfigPath = strings.Replace(volumesConfigPath, `\`, `/`, -1)
8585
containerStoragePath = strings.Replace(containerStoragePath, `\`, `/`, -1)
8686
}
87+
isolation = info.Isolation
8788
}
8889

8990
func convertBasesize(basesizeBytes int64) (int64, error) {

0 commit comments

Comments
 (0)