Skip to content

Support relative paths with bind mounts (volumes) #1203

@borekb

Description

@borekb

As previously discussed in moby/moby#4830, it would be useful to be able to bind-mount relative paths like this:

docker run --mount type=bind,source=host-dir,target=/app ...

Note: The original issue suggests docker run -v host-dir:/app ... which might (probably?) be confused with named volumes so I think it's more likely to expect it from the newer --mount option.

The two main motivations for this are:

  • Consistency with docker-compose.
  • Ability to write cross-platform docker run commands, e.g., we have a npm script that currently does something like "start": "docker run -v $PWD:/app ...". It's not easy at all to write a command that would work across Linux, macOS and Windows today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions