mariotoffia / FluentDocker

Use docker, docker-compose local and remote in tests and your .NET core/full framework apps via a FluentAPI
Apache License 2.0
1.31k stars 97 forks source link

Mount("/path/host", "/path/container", ountType.ReadWrite) not working like -v /path/host:/path/container #272

Open madf0x opened 2 years ago

madf0x commented 2 years ago

Hey,

I've been trying to use FluentDocker to set up a container, that should save files to a specific path.

When I use the docker CLI directly with -v /pathHost:/pathCont the container works as expected and all files written in the pathCont while executing the container are visible on the host machine.

Doing the same with FluentDocker results in a container, that looks exactly the same when doing docker inspect on both containers, except that one label is missing:

            "desktop.docker.io/wsl-distro": "Debian",

I've tried adding that using .WithLabel("desktop.docker.io/wsl-distro", "Debian") or .WithLabel(new [] {"desktop.docker.io/wsl-distro", "Debian"}) ... but this resulted in 2 labels without values assigned.

Can this missing label cause the problem, that one volume bind is working and the other one isn't? I'm out of ideas for now.

madf0x commented 2 years ago

I've managed to add the label using

        .WithLabel("\"desktop.docker.io/wsl-distro\"=\"Debian\"")

But still no luck. Manually started using DockerCLI works, using FluentDocker doesn't. same

Here is the Notepad++ Compare output of the two containers.