Skip to content

Using bind mounts with nonexistent directory leads to error #10088

Description

@ethancn

File: storage/bind-mounts.md

As the doc above said, when using bind mounts, "The file or directory does not need to exist on the Docker host already. It is created on demand if it does not yet exist", but this is not the same as what I tested.

I ran the following command with a nonexistent directory /home/workspace/app,

docker run -it \
  --name mycontainer \
  --mount type=bind,src="$(pwd)"/app,dst=/usr/src/app \
  alpine:latest

and got this error: invalid mount config for type "bind": bind source path does not exist: /home/workspace/app.

屏幕快照 2019-12-26 下午6 18 35

I think the doc is incorrect about this. The host is CentOS 7 with Docker 19.03.5 installed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions