Mount
API can't fully replace the legacy Bind
API
#42332
Labels
area/api
area/volumes
kind/enhancement
Enhancements are not bugs or new features but can improve usability or performance.
Description
docker
-v
short notation for volume mounts uses theHostConfig.Bind
field on ContainerCreate API, and can't be fully translated into--mount
flags (Volumes
in ContainerCreate API) because the latter does not offer option to create missing host path on bind mount.The
--mount
flag exposes many advanced options that can be used to tweak the binding, which are not available with the short-v
notation. This prevents user to benefit those advanced features with the same "create if missing" behaviour.I suggest an additional option is introduce on mount, so that user can get best of both, and tools can adopt the mount API.
Steps to reproduce the issue:
Describe the results you received:
bind source path does not exist
Describe the results you expected:
I get an option to run 1. and get the source path created on host
or I get an option to run 2. and set the non_recursive flag
Additional information you deem important (e.g. issue happens only occasionally):
see discussion on docker/compose-cli#1563 (comment) as initial reason I had to look into this :P
Output of
docker version
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: