Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

docker-compose up not working in ubuntu(18.04) subsystem in Windows 10 #3

Open
cmaturi opened this issue Mar 28, 2019 · 7 comments
Open
Assignees

Comments

@cmaturi
Copy link
Collaborator

cmaturi commented Mar 28, 2019

cmaturi@TECH-P10R95897:~/git/shib-in-a-box$ docker-compose up
Removing shib-in-a-box_alb_1
shib-in-a-box_service_1 is up-to-date
Recreating 780d690fbd3c_shib-in-a-box_alb_1 ...
Starting shib-in-a-box_config_1             ...
Recreating 780d690fbd3c_shib-in-a-box_alb_1 ... error
Starting shib-in-a-box_cron_1               ...
Starting shib-in-a-box_cron_1               ... done

ERROR: for 780d690fbd3c_shib-in-a-box_alb_1  Cannot start service alb: b'OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/home/cmaturi/git/shib-in-a-box/nginx.conf\\\\\\" to rootfs \\\\\\"/var/lib/docker/overlay2/bd23da6e4ede33ff4934300e89ccf53e8838b0c526ba38927a6ec026dd9df0c5/merged\\\\\\" at \\\\\\"/var/lib/docker/overlay2/bd23da6e4ede33ff4934300e89ccf53e8838b0c526ba38927a6ec026dd9df0c5/merged/Starting shib-in-a-box_config_1             ... done
 vice-versa)? Check if the specified host path exists and is the expected type'
shib-in-a-box_httpd_1 is up-to-date
shib-in-a-box_shibd_1 is up-to-date

ERROR: for alb  Cannot start service alb: b'OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/home/cmaturi/git/shib-in-a-box/nginx.conf\\\\\\" to rootfs \\\\\\"/var/lib/docker/overlay2/bd23da6e4ede33ff4934300e89ccf53e8838b0c526ba38927a6ec026dd9df0c5/merged\\\\\\" at \\\\\\"/var/lib/docker/overlay2/bd23da6e4ede33ff4934300e89ccf53e8838b0c526ba38927a6ec026dd9df0c5/merged/etc/nginx/nginx.conf\\\\\\" 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.

Also tried the following:

cmaturi@TECH-P10R95897:~/git/shib-in-a-box$ ls /mnt
c
cmaturi@TECH-P10R95897:~/git/shib-in-a-box$ ls /
bin  boot  dev  etc  home  init  lib  lib64  media  mnt  opt  proc  root  run  sbin  snap  srv  sys  tmp  usr  var
cmaturi@TECH-P10R95897:~/git/shib-in-a-box$ sudo ln -s /mnt/c /c
@ddriddle
Copy link
Collaborator

Tomorrow let's take a closer look at this link:

microsoft/WSL#1854

@evanjtravis
Copy link
Collaborator

Mounting any volumes in WSL requires that they exist as Windows paths in the first place.

Does not work:

 docker run --rm -it -v ~/.aws:/root/.aws debian bash

Works:

 docker run --rm -it -v /c/Users/{NetID}/.aws:/root/.aws debian bash

@ddriddle
Copy link
Collaborator

@evanjtravis and @cmaturi a potential workaround for this problem is to move your home directory to /c/home or some other place on your C: drive. See the following article for details:

https://www.brianketelsen.com/going-overboard-with-wsl-metadata/

The article above is a bit wordy, but the approach is easy enough. Create a /c/home/ directory, copy the contents of your home directory there, then edit /etc/password:

-netid:x:1000:1000:,,,:/home/netid:/bin/bash
+netid:x:1000:1000:,,,:/c/home:/bin/bash

This approach seems straightforward and I think it will work. It is worth a try.

@cmaturi
Copy link
Collaborator Author

cmaturi commented Apr 8, 2019

Tried the following in windows cmd prompt. Still seeing the same issue

C:\Users\cmaturi>docker run --rm -it -v "c:\Users\cmaturi":/root/win debian
root@ee645523858c:/# cd /win
bash: cd: /win: No such file or directory
root@ee645523858c:/# cd
root@ee645523858c:~# ls
win
root@ee645523858c:~# cd win
root@ee645523858c:~/win# ls
root@ee645523858c:~/win#

@ddriddle
Copy link
Collaborator

ddriddle commented Apr 8, 2019

Turns out this is a Windows for Docker issue not a WSL issue. When you change your Windows password, you will NO longer be able to mount you C drive. Since @cmaturi and @evanjtravis are using AD passwords, every time their AD password changes, it will be necessary to unshare your C drive in the Docker for Windows GUI and then reshare it. This requires you to enter your new password. This is a known issue:

docker/for-win#1712

@ddriddle ddriddle closed this as completed Apr 8, 2019
@cmaturi
Copy link
Collaborator Author

cmaturi commented Apr 8, 2019

@evanjtravis I am able to mount unix file system using docker:

cmaturi@TECH-P10R95897:/$ docker run --rm -it -v $PWD:/root/win debian  ls -la  /root/win
total 4036
drwxr-xr-x   1 root root      280 Apr  8 15:06 .
drwx------   1 root root     4096 Apr  8 15:28 ..
lrwxrwxrwx   1 root root       11 Apr  8 15:06 C -> /host_mnt/c
drwxr-xr-x   2 root root    14336 Feb 13 10:29 bin
lrwxrwxrwx   1 root root       11 Apr  8 15:06 c -> /host_mnt/c
drwxr-xr-x  11 root root     2940 Apr  3 17:14 dev
drwxr-xr-x   1 root root      140 Apr  3 17:14 etc
drwxr-xr-x   1 root root       60 Apr  8 15:26 home
drwxr-xr-x   3 root root       60 Apr  8 14:47 host_mnt
drwxr-xr-x   1 root root       60 Apr  3 17:14 lib
drwxr-xr-x   5 root root     2048 Feb 13 10:28 media
drwxr-xr-x   2 root root     2048 Feb 13 10:28 mnt
drwxr-xr-x   1 root root       80 Apr  3 17:14 opt
drwxrwxrwx   1 1001 staff       0 May  4  2006 port
dr-xr-xr-x 143 root root        0 Apr  3 11:13 proc
drwx------   2 root root     2048 Feb 13 10:29 root
drwxr-xr-x   1 root root      120 Apr  8 15:00 run
drwxr-xr-x   2 root root    22528 Feb 13 10:29 sbin
-rwxr-xr-x   1 root root  4081048 Jan 11 08:26 sendtohost
drwxr-xr-x   2 root root     2048 Feb 13 10:28 srv
dr-xr-xr-x  13 root root        0 Apr  3 11:13 sys
drwxrwxrwt   1 root root       40 Apr  8 15:28 tmp
drwxr-xr-x   1 root root       80 Feb 13 10:29 usr
drwxr-xr-x  12 root root     2048 Feb 13 10:29 var

@cmaturi
Copy link
Collaborator Author

cmaturi commented Apr 8, 2019

I am able to mount / and /usr/bin, but I am not able to mount /home . I am also able to mount /c/Users/cmaturi , but not the .aws directory.

@cmaturi cmaturi reopened this Apr 8, 2019
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

3 participants