Enable relative paths for driver_opts.device#7762
Enable relative paths for driver_opts.device#7762ulyssessouza merged 2 commits intodocker:masterfrom
Conversation
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: aiordache <anca.iordache@docker.com>
| return | ||
| o = config['driver_opts'].get('o') | ||
| device = config['driver_opts'].get('device') | ||
| if o and o == 'bind' and device: |
There was a problem hiding this comment.
nit:
| if o and o == 'bind' and device: | |
| if o == 'bind' and device: |
|
Please see #7856, I believe this introduced a BC break on a point release. The check for existing volumes with different "driver_opts.device" value needs updated to check resolved path returned from the daemon. |
|
@aiordache I think there's another related regression affecting me because of this. I execute docker-compose on Windows, with a remote docker host on Linux. The expansion/abs path transformation ends up converting Linux absolute paths (like /path/from/root), into Windows-style paths (like C:/path/from/root), which ends up as an invalid path on the remote filesystem (and caused my volumes to report that the 'device' changed even though I haven't changed my docker-compose file in years). Anything we can do to fix this? Maybe don't try to normalize these paths when you're not talking to a local docker daemon, since the filesystem is totally different? |
The driver options for a volume are forwarded to the docker engine unmodified (as specified in the compose file). #6343 requests support for relative paths in the 'device' option of the
localdriver.This patch converts the relative paths for
driver_opts.deviceto absolute paths (only for alocaldriver andbindmount option).docker-compose.yml
Resolves #6343