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.
As previously discussed in moby/moby#4830, it would be useful to be able to bind-mount relative paths like this:
The two main motivations for this are:
docker runcommands, 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.