Dealing with “Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting ”/foo/bar/data.json“ to rootfs at ”/app/data.json“: mount src=/foo/bar/data.json, dst=/app/data.json, dstFd=/proc/thread-self/fd/11, flags=MS_BIND|MS_REC: not a directory: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type”

I recently spent great amount of time dealing with the error Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/foo/bar/data.json" to rootfs at "/app/data.json": mount src=/foo/bar/data.json, dst=/app/data.json,…