Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Build fails on Windows Subsystem for Linux (WSL) #81

Closed
dana-ross opened this issue Mar 1, 2018 · 2 comments
Closed

Build fails on Windows Subsystem for Linux (WSL) #81

dana-ross opened this issue Mar 1, 2018 · 2 comments

Comments

@dana-ross
Copy link
Contributor

Building containers works if I initiate it from the Windows side (cmd.exe), but fails if I start it from WSL's bash:

ERROR: for oshpdlocaldocker_phpfpm_1  Cannot start service phpfpm: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/c/Users/dave/Code/oshpd-local-docker/config/php-fpm/docker-php-ext-xdebug.ini\\\" to rootfs \\\"/var/lib/docker/overlay2/b36de1f5ef320d7607a5a5b7d2c6cb40d6b325c77ac0266a983b59ce20c24f8d/merged\\\" at \\\"/var/lib/docker/overlay2/b36de1f5ef320d7607a5a5b7d2c6cb40d6b325c77ac0266a983b59ce20c24f8d/merged/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini\\\" 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 phpfpm  Cannot start service phpfpm: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/c/Users/dave/Code/oshpd-local-docker/config/php-fpm/docker-php-ext-xdebug.ini\\\" to rootfs \\\"/var/lib/docker/overlay2/b36de1f5ef320d7607a5a5b7d2c6cb40d6b325c77ac0266a983b59ce20c24f8d/merged\\\" at \\\"/var/lib/docker/overlay2/b36de1f5ef320d7607a5a5b7d2c6cb40d6b325c77ac0266a983b59ce20c24f8d/merged/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini\\\" 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.

Need to debug this further when I get a chance

@dana-ross
Copy link
Contributor Author

Following up on this:

It's a discrepancy between WSL and Docker for Windows. WSL mounts the C: drive at /mnt/c and Docker's base VM mounts it at /c and it has trouble mounting files directly in this situation.

A work-around is available:

$ sudo mkdir /c
$ sudo mount --bind /mnt/c /c
$ cd /c/path/to/project
$ docker-compose up

In the longer term, the WSL team is working with the Docker team to find a way to resolve it.

@Viper007Bond
Copy link

Viper007Bond commented Mar 26, 2018

Have you seen this? It seems to provide a solution but perhaps I'm not understanding the issue correctly.

https://blogs.technet.microsoft.com/virtualization/2017/12/08/wsl-interoperability-with-docker/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants