Home › Docker

invalid mount config for type "bind": bind source path does not exist (Docker) — how to fix

docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /home/me/app/data.
See 'docker run --help'.

Quick fix: Create the directory first (mkdir -p ./data) and pass an absolute path: --mount type=bind,source="$(pwd)"/data,target=/data. On Docker Desktop make sure the folder is under a shared path (Settings → Resources → File sharing). On Git Bash for Windows, prefix the command with MSYS_NO_PATHCONV=1.

What it means

A bind mount maps a path on the Docker host into the container. The daemon checks that the source path exists when it creates the container. Two details explain most cases:

Cause 1: the directory or file really doesn't exist

A typo, a relative path resolved from a different directory, or a file that is created by a later step.

Fix: create it and use an absolute path:

mkdir -p "$(pwd)/data"
docker run --mount type=bind,source="$(pwd)"/data,target=/data myimage

Pass an absolute source path ("$(pwd)"/data) so it doesn't depend on how relative paths are resolved. When mounting a single file (a config file, for example), create the file first. If it's missing, -v would create a directory with that name instead.

Cause 2: Docker Compose

Compose resolves relative paths from the directory of the compose file:

services:
  app:
    image: myimage
    volumes:
      - ./data:/data                 # short syntax: created if missing
      - type: bind                   # long syntax
        source: ./config
        target: /etc/app

With the long syntax, create the source beforehand, or allow Compose to create it:

      - type: bind
        source: ./config
        target: /etc/app
        bind:
          create_host_path: true

Run docker compose config to see the absolute paths Compose actually uses.

Cause 3: Docker Desktop can't see the path

On macOS and Windows the daemon runs in a VM and only sees shared folders.

Fix: in Docker Desktop, open Settings → Resources → File sharing and add the parent folder (on macOS, /Users is shared by default). On Windows with WSL 2, keep projects inside the WSL filesystem (/home/<you>/...) and run docker from the WSL shell. Mixing a Windows path in one shell with a Linux path in another is a common source of this error.

Cause 4: Git Bash on Windows rewrote the path

Git Bash (MSYS) converts arguments that look like Unix paths into Windows paths, which breaks -v and --mount values.

MSYS_NO_PATHCONV=1 docker run -v "$(pwd)"/data:/data myimage

Or use PowerShell: docker run -v ${PWD}/data:/data myimage.

Cause 5: the daemon is on another machine or in a sandbox

Check what the daemon sees

docker run --rm -v /:/host alpine ls -la /host/home/me/app

If the directory is missing in that listing, the daemon's host and your shell aren't the same machine or filesystem.

Last updated 2026-12-04.