Docker Community Forums

Share and learn in the Docker community.

--mount doesn't work with Windows path


(Reign1) #1

Hi, trying to mount volume with some data onto the container. While -v works fine --mount shows errors:

docker run --rm -v c:/Users:/data alpine ls /data <— works fine

docker run --rm --mount source=c:/Users/data,destination=/data alpine ls /data <-- error below

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: create c:/Users/data: “c:/Users/data” includes invalid characters for a local volume name, only “[a-zA-Z0-9][a-zA-Z0-9_.-]” are allowed. If you intended to pass a host directory, use absolute path.

Doesn’t --mount support Windows paths or what is tha case here? Thanks.