oci runtime errorでdockerが起動しなくなった件(windows編)

結論：factory defaultsにrevertしました。

dockerをWindowsで起動しようとしたら、いきなりこのようなエラーが発生し

```
(golang) C:\projectenv\gmo_plt_gpucloud_sdk\files\docker>docker-compose --file docker-compose.dev.yml up
    Creating network "docker_gcloud_net" with driver "bridge" 
    Removing docker_db_1
    Recreating 1d5228af60f3_docker_db_1 ... error
    Creating docker_python37_1          ... done

    ERROR: for 1d5228af60f3_docker_db_1  Cannot start service db: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/host_mnt/c/projectenv/gmo_plt_gpucloud_sdk/files/docker/files/etc/mysql/my.cnf\\\" to rootfs \\\"/var/lib/docker/overlay2/6eb8719a8903fa7b0b739e0df16346f8dc6e9947f166ad8302a37b6a80b1667f/merged\\\" at \\\"/var/lib/docker/overlay2/6eb8719a8903fa7b0b739e0df16346f8dc6e9947f166ad8302a37b6a80b1667f/merged/etc/mysql/mysql.cnf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

    ERROR: for db  Cannot start service db: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/host_mnt/c/projectenv/gmo_plt_gpucloud_sdk/files/docker/files/etc/mysql/my.cnf\\\" to rootfs \\\"/var/lib/docker/overlay2/6eb8719a8903fa7b0b739e0df16346f8dc6e9947f166ad8302a37b6a80b1667f/merged\\\" at \\\"/var/lib/docker/overlay2/6eb8719a8903fa7b0b739e0df16346f8dc6e9947f166ad8302a37b6a80b1667f/merged/etc/mysql/mysql.cnf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
    ERROR: Encountered errors while bringing up the project.
```

次を試してみたところ、no luck

- docker system prune
- docker restart
- windows restart


[https://qiita.com/kazumax55/items/66b86e9da21f0f383501](https://qiita.com/kazumax55/items/66b86e9da21f0f383501) には 
`cd /run/runc/ && rm -rf *`
で解決したそうだが、Windowsの場合は、daemonが仮想マシンであるため、そのようにすることができなかった。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/7938e0c2-b810-5b3b-bb3b-f22c5b836d26.png)

Versionを確認したところ

```
C:\ProgramData\Docker\config>docker version
Client: Docker Engine - Community
 Version:           18.09.3
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        774a1f4
 Built:             Thu Feb 28 06:32:50 2019
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          18.09.3
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       774a1f4
  Built:            Thu Feb 28 06:40:58 2019
  OS/Arch:          linux/amd64
  Experimental:     true
```

edge?
edge使ってた？一応戻しました。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/f39b0405-1355-163c-9d48-67d163e02358.png)

No luck
Resetの Restart Docker Desktopをやってみたが、これはdocker serviceを再起動することと一緒だった。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/9ddc46e5-7908-cb70-680d-28f8f4326694.png)

Htyper V ManagerでVM再起動を確認した。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/555741a3-0595-df7b-f952-385094c5cb9e.png)

なので、Revert to factory defaultsを選択。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/04c64574-5eb5-31d7-618f-8b368cb471c7.png)

Reset button押して元々24Gだったvhdxがなくなることを確認したが、

```
C:\projectenv\gmo_plt_gpucloud_sdk\files\docker>cd C:\Users\Public\Documents\Hyper-V\Virtual hard disks

C:\Users\Public\Documents\Hyper-V\Virtual hard disks>ls
DockerDesktop.vhdx

C:\Users\Public\Documents\Hyper-V\Virtual hard disks>dir
 Volume in drive C has no label.
 Volume Serial Number is 78A3-5182

 Directory of C:\Users\Public\Documents\Hyper-V\Virtual hard disks

2019/02/07  09:02    <DIR>          .
2019/02/07  09:02    <DIR>          ..
2019/04/04  16:58    24,901,582,848 DockerDesktop.vhdx
               1 File(s) 24,901,582,848 bytes
               2 Dir(s)  252,538,396,672 bytes free
```

あれ？何かの場所が変わった。サービス立ち上がったのにvhdxファイルがない。
Hyper-V managerで場所を確認してみた。

```
C:\Users\Public\Documents\Hyper-V\Virtual hard disks>dir
 Volume in drive C has no label.
 Volume Serial Number is 78A3-5182

 Directory of C:\Users\Public\Documents\Hyper-V\Virtual hard disks

2019/04/04  17:33    <DIR>          .
2019/04/04  17:33    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  276,935,278,592 bytes free

C:\Users\Public\Documents\Hyper-V\Virtual hard disks>cd C:\ProgramData\DockerDesktop\vm-data\

C:\ProgramData\DockerDesktop\vm-data>dir
 Volume in drive C has no label.
 Volume Serial Number is 78A3-5182

 Directory of C:\ProgramData\DockerDesktop\vm-data

2019/04/04  17:33    <DIR>          .
2019/04/04  17:33    <DIR>          ..
2019/04/04  17:36       104,857,600 DockerDesktop.vhdx
               1 File(s)    104,857,600 bytes
               2 Dir(s)  276,934,049,792 bytes free
```

じゃ、元々のdocker instanceを再起動

```
C:\projectenv\gmo_plt_gpucloud_sdk\files\docker>docker-compose up
Creating network "docker_default" with the default driver
Pulling db (mysql:5.7.25)...
5.7.25: Pulling from library/mysql
27833a3ba0a5: Pull complete
864c283b3c4b: Pull complete
cea281b2278b: Pull complete
8f856c14f5af: Pull complete
9c4f38c23b6f: Pull complete
1b810e1751b3: Pull complete
5479aaef3d30: Pull complete
1d924ec3d520: Pull complete
1ab7ae63ac60: Pull complete
08aa5f3680e9: Pull complete
a832d0a0972a: Pull complete
Digest: sha256:dba5fed182e64064b688ccd22b2f9cad4ee88608c82f8cff21e17bab8da72b81
Status: Downloaded newer image for mysql:5.7.25
Creating docker_db_1 ...
```

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/592970d3-bb40-3e6d-ee08-a711f9e07755.png)

で治りました。

![image.png](https://qiita-image-store.s3.amazonaws.com/0/12587/ab83589c-617f-8b38-cc5f-83d90064b211.png)

以上。