Docker for Windows を入れてみた


# 環境
* Windows 10 Professional 
* Docker for Windows 17.09.0-ce

スイッチしてそれぞれdocker infoを打って違いを見てみた。

# docker info (Linux)

Switch to Linux Containers...

* Storage Driver・・・**overlay2**
    * Backing Filesystem・・・**extfs**
* runtime ・・・**runc**
* OSType・・・**Linux**
* Operating System・・・**Alpine Linux v3.5**
* Docker Root Dir・・・**/var/lib/docker**

```text
PS C:\Users\tie304410> docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 2
Server Version: 17.09.0-ce
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 logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.49-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: 35C3:5MXK:MU7Z:CSWS:PCDX:SBMJ:EXMF:46YZ:ZRUR:VVW2:GRVY:E7OH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 16
 Goroutines: 26
 System Time: 2017-11-21T23:35:01.4540411Z
 EventsListeners: 0
Http Proxy: xxx.xxx.xxx.co.jp:8080
Https Proxy: xxx.xxx.xxx.co.jp:8080
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
```
# docker info (Windows)
Switch to Windows Containers...

* Storage Driver・・・**windowsfilter**
* Isolation・・・**hyperv**
* OSType・・・**Windows**
* Operating System・・・**Windows 10 Pro**
* Docker Root Dir・・・**C:\ProgramData\Docker**

```text
PS C:\Users\tie304410> docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 17.09.0-ce
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 14393 (14393.1770.amd64fre.rs1_release.170917-1700)
Operating System: Windows 10 Pro
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.899GiB
Name: S1706C10664-T1
ID: 4IEU:KVRB:CA5F:ZCNM:MNNC:INHX:PYA5:NEVC:2HZQ:VYDK:XVZ4:R273
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 23
 System Time: 2017-11-22T08:35:45.7868082+09:00
 EventsListeners: 0
Http Proxy: yyy.yyy.yyy.co.jp:8080
Https Proxy: yyy.yyy.yyy.co.jp:8080
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
```

# Windows mode と Linux modeのスイッチ

```shell-session
PS C:\Program Files\Docker\Docker> .\DockerCli.exe
Usage: DockerCli.exe [-SwitchDaemon] [-Version]
  -Version: Show the Docker for Windows version information
  -SwitchDaemon: Point the Docker CLI to either Linux containers or Windows containers
  -SharedDrives: List the shared drives
PS C:\Program Files\Docker\Docker> .\DockerCli.exe -SwitchDaemon

# Linux mode
PS C:\Program Files\Docker\Docker> docker version
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:45:38 2017
 OS/Arch:      linux/amd64
 Experimental: true

# スイッチ
PS C:\Program Files\Docker\Docker> .\DockerCli.exe -SwitchDaemon

# Windows mode
PS C:\Program Files\Docker\Docker> docker version
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:50:27 2017
 OS/Arch:      windows/amd64
 Experimental: true
```

当然、**Client**は同じですね。**Server**がスイッチで変わってるのがわかります。

> タスクトレイのDocker for Windowsアイコンからもできます。


# 気づいたこと

* Http Proxy/Https Proxyはそれぞれ別の情報を保持
* CPUsとTotal Memoryは、Linux Switch時はHyper-V上で建てられているVirtual Machine（*MobyLinuxVM*）のリソース情報、Windows Switch時は母艦のリソース情報