DockerCLI/cli/compose
Sebastiaan van Stijn d6dd08d568
Detect Windows absolute paths on non-Windows CLI
When deploying a stack using a relative path as bind-mount
source in the compose file, the CLI converts the relative
path to an absolute path, relative to the location of the
docker-compose file.

This causes a problem when deploying a stack that uses
an absolute Windows path, because a non-Windows client will
fail to detect that the path (e.g. `C:\somedir`) is an absolute
path (and not a relative directory named `C:\`).

The existing code did already take Windows clients deploying
a Linux stack into account (by checking if the path had a leading
slash). This patch adds the reverse, and adds detection for Windows
absolute paths on non-Windows clients.

The code used to detect Windows absolute paths is copied from the
Golang filepath package;
1d0e94b1e1/src/path/filepath/path_windows.go (L12-L65)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-10 21:25:03 +02:00
..
convert add support for config credentialspecs to compose 2019-04-12 11:17:34 -05:00
interpolation Add options to the compose loader 2018-06-25 17:15:26 +02:00
loader Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00
schema Add support for using Configs as CredentialSpecs in services 2019-04-12 11:17:29 -05:00
template Fix some spelling errors 2019-01-11 15:49:02 +08:00
types Add support for using Configs as CredentialSpecs in services 2019-04-12 11:17:29 -05:00