You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docker bound volume mounts resolve to OS local path #993
Encountering an issue when attempting to create a container which includes a bind typed volume mount.
The problem is internally, the path is resolved as the local OS system. This is fine when docker is also running locally, however, when accessing a separate Docker context from WSL, the path is incorrect.
Even when providing an absolute path, the path is resolved to a Windows path.
For example, say we create a container with a single volume mount:
var resource = new ContainerResource(name);
builder.AddResource(resource)
.WithVolumeMount("/etc/container-test", $"/app/{name}", VolumeMountType.Named)
.WithAnnotation(new ContainerImageAnnotation { Image = "some-image", Tag = "latest" });
The path specified at "/etc/container-test" ends up being resolved to: "C:\project-directory\etc\container-test".
My proposal would be to check if the path is rooted (Path.IsPathRooted) before calling Path.GetFullPath. This should continue to work cross platform (whilst accessing a subsystem like in this case).
Activity
ghost added
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Activity
davidfowl commentedon Nov 22, 2023
Send a PR?
Fix an issue when using docker context from WSL mounted path resolvin…
r0ss88 commentedon Nov 22, 2023
David Fowler (@davidfowl) thank you for responding so quickly!
#997
Added tests to cover fix (microsoft#993)
BrennanConroy commentedon Jan 22, 2024
Done via #997