docker-windows-volume-watcher icon indicating copy to clipboard operation
docker-windows-volume-watcher copied to clipboard

Doesn't Work for WSL2

Open omaraltayyan opened this issue 5 years ago • 4 comments

Running this command in Windows subsystem for linux 2 seems to break it.

this is the message i get for my container:


WARNING:root:Bind of container web_1 was skipped since it has invalid source path /run/desktop/mnt/host/d/user/project_dir


omaraltayyan avatar Jun 09 '20 14:06 omaraltayyan

I can confirm this isn't working with same error on WSL2.

WARNING:root:Bind of container ueg-web_app_1 was skipped since it has invalid source path /run/desktop/mnt/host/c/Users/Jeremy/Documents/GitHub/ueg-web

jeremybalog avatar Jun 09 '20 15:06 jeremybalog

I can confirm this isn't working with same error on WSL2.

WARNING:root:Bind of container ueg-web_app_1 was skipped since it has invalid source path /run/desktop/mnt/host/c/Users/Jeremy/Documents/GitHub/ueg-web

Sadly for WSL2 file watch commands don't work anymore, this seemed like a possible workaround, the other one is moving files to inside of WSL2's directory but this breaks a lot of windows software we use since it's a mounted folder

omaraltayyan avatar Jun 09 '20 16:06 omaraltayyan

Hello, You can modify the docker_bind_to_windows_path function in the container_monitor.py scritp. Adding a different regular expression and checking both, the old and new one and then making the exe file again. For example this worked for me:

` def docker_bind_to_windows_path(path):

expr = re.compile('^(?:/host_mnt)?/([a-zA-Z])/(.*)$')
expr2 = re.compile('^([A-Za-z]):\\\\(.*)$')

match = re.match(expr, path)
match2 = re.match(expr2, path)

if not match:
    if not match2:
        return None
    else:
        return '%s:\\%s' % match2.groups()
else:
    return '%s:\\%s' % match.groups()`

lozanotc7 avatar Nov 09 '20 07:11 lozanotc7

Hello, You can modify the docker_bind_to_windows_path function in the container_monitor.py scritp. Adding a different regular expression and checking both, the old and new one and then making the exe file again. For example this worked for me:

` def docker_bind_to_windows_path(path):

expr = re.compile('^(?:/host_mnt)?/([a-zA-Z])/(.*)$')
expr2 = re.compile('^([A-Za-z]):\\\\(.*)$')

match = re.match(expr, path)
match2 = re.match(expr2, path)

if not match:
    if not match2:
        return None
    else:
        return '%s:\\%s' % match2.groups()
else:
    return '%s:\\%s' % match.groups()`

You're my saviour!

bunglegrind avatar Jan 28 '22 13:01 bunglegrind