Docker Compose Bind Mount "source path does not exist" in CI
A bind mount in compose points at a host path that does not exist on the CI runner. Locally the directory is there; on a fresh checkout it is not.
What this error means
docker compose up fails with bind source path does not exist: <path> or are you trying to mount a directory onto a file (or vice-versa). The same compose file works on your machine.
Error response from daemon: invalid mount config for type "bind":
bind source path does not exist: /home/runner/work/app/app/config/localCommon causes
Host path absent on the runner
A bind mount references a directory that exists locally but was never created or checked out in CI (gitignored config, a build output dir, a developer-only path).
Relative path resolved from the wrong directory
Relative bind mounts resolve from the compose file’s directory; running from elsewhere points the mount at a non-existent location.
Mounting a file where a directory is expected
If the host side is a file but the container path is a directory (or vice versa), Docker reports the directory-onto-file variant of this error.
How to fix it
Create the path before compose runs
Ensure the host directory/file exists in the job.
mkdir -p config/local
docker compose up -dUse a named volume or correct the path type
- Prefer a named volume over a host bind mount for CI-only data.
- Match file-vs-directory between host source and container target.
- Run compose from the directory its relative paths assume.
How to prevent it
- Create required host paths as an explicit CI step, or use named volumes.
- Avoid developer-only bind mounts in compose files used by CI (split via override files).
- Keep relative mount paths consistent with the run directory.