avatarjanac

Summary

This web page provides solutions for the Docker error "Error response from daemon: invalid mount config for type “bind”: bind source path does not exist:" and discusses potential causes.

Abstract

The web page titled "Docker Error: Error response from daemon: invalid mount config for type “bind”: bind source path does not exist:" discusses a common Docker error and provides three solutions to resolve it. The error occurs when running the command "docker compose up -d db" and is caused by an invalid mount configuration for the bind type, where the bind source path does not exist.

The first solution involves creating the missing path in the project root directory. The second solution is for macOS users and involves enabling full disk access for Docker and the terminal or iTerm2 in the macOS settings. The third solution is for Windows users and involves updating the password and resetting the credentials for shared drives in the Docker for Windows settings.

The web page also provides links to additional resources, including a GitHub thread and a StackOverflow post, for further assistance with this error.

Bullet points

  • The error message "Error response from daemon: invalid mount config for type “bind”: bind source path does not exist:" occurs when running the command "docker compose up -d db".
  • The error is caused by an invalid mount configuration for the bind type, where the bind source path does not exist.
  • Solution 1: Create the missing path in the project root directory.
  • Solution 2 (macOS): Enable full disk access for Docker and the terminal or iTerm2 in the macOS settings.
  • Solution 3 (Windows): Update the password and reset the credentials for shared drives in the Docker for Windows settings.
  • Additional resources: GitHub thread and StackOverflow post.

Docker Error: Error response from daemon: invalid mount config for type “bind”: bind source path does not exist:

Error: Bind Source Path Does Not Exist

I got this error:

Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /tmp/my_repo/.tmp

when running this command:

docker compose up -d db

Solution 1: Create the path

It was easily solved for me by creating a .tmp directory at the location that is specified in the error message (for me it was the project root).

Solution 2: macOS — Enable Full Disk Access

Make sure Docker and terminal/iTerm2 have full disk access enabled in the macOS settings.

  1. Go to: macOS Settings » Security » Privacy » Full Disk Access.
  2. Add Docker.
  3. Add Terminal.
  4. Add iTerm2 (if you use this).

Solution 3: Windows — Update password

As per this Github thread, you may run into this on Windows after you change your Windows account password.

  1. Open Docker for Windows Settings.
  2. Click Shared Drives / Reset credentials
  3. Share drive once again.

More Resources

  1. https://github.com/docker/docker.github.io/issues/4709
  2. https://stackoverflow.com/questions/61316142/invalid-mount-config-for-type-bind-bind-mount-source-path-does-not-exist-ho
Docker
Technology
Development
Software Development
Recommended from ReadMedium