bind source path does not exist 🐳 Docker

invalid mount config for type "bind": bind source path does not exist

A -v/--mount or Compose volume points at a host path that doesn’t exist (from the Docker daemon’s point of view).

Seen on: Docker

Meaning

With --mount type=bind Docker refuses missing paths (-v silently creates an empty directory). On Docker Desktop and remote contexts, the path must exist on the machine/VM running the daemon, and Windows paths need the right format.

Common causes

  • Typo or relative path resolved from another directory
  • Path exists on your laptop but the daemon is remote/VM
  • Windows path format (C:\ vs /c/)
  • File not created yet (e.g. a config file)

⚡ Quick fix

  1. Use an absolute path: "$(pwd)/config"
  2. Create the file/folder first
  3. On Windows use C:/path or /c/path consistently

Detailed fix by platform

Docker

  1. bash
    mkdir -p "$(pwd)/data"
    docker run --mount type=bind,source="$(pwd)/data",target=/data alpine ls /data

How to diagnose

  1. Path — ls -la the exact source path
  2. Daemon — Local or remote context?
  3. Format — Windows path style

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.