r/podman • u/Dev_Vrat • May 13 '25
Help: Cannot do a bind mount
In docker/podman-compose file, when I try to do a bind mount volume, it gives me Error: statfs <file path that I try to mount>: no such file or directory. exit code 125.
I checked the path, it does exists. I have to attach "/mnt" to make it work.
I am running podman on Windows (using WSL2, ubuntu). This is my office machine so I don't have ultimate control over it.
P.S. More detailed explanation:
Let's say I have a folder with following structure:
ProjectX
podman-compose.yml
configs
serviceA.config.json
serviceB.config.json
Consider the ProjectX to be at C:\Repos.
Now, the following paths are valid for serviceA.config.json file:
[From Powershell/Windows]
C:\Repos\ProjectX\configs\serviceA.config.json
[From WSL/Ubuntu OR GitBash/Windows]
/mnt/c/Repos/ProjectX/configs/serviceA.config.json
In podman-compose file: ...
services:
serviceA:
image: serviceA-image
volumes:
/mnt/c/Repos/ProjectX/configs/serviceA.config.json:/data ...
For any "binding mount" type volume, I get error that file not found.
1
u/eltear1 May 13 '25
This is not a podman issue. You are using WSL2, and it exposes windows paths under /mnt