結論: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 には
cd /run/runc/ && rm -rf *
で解決したそうだが、Windowsの場合は、daemonが仮想マシンであるため、そのようにすることができなかった。
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使ってた?一応戻しました。
No luck
Resetの Restart Docker Desktopをやってみたが、これはdocker serviceを再起動することと一緒だった。
Htyper V ManagerでVM再起動を確認した。
なので、Revert to factory defaultsを選択。
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 ...
で治りました。
以上。