docker-client icon indicating copy to clipboard operation
docker-client copied to clipboard

Allow relative bind mount directories

Open tobad357 opened this issue 8 years ago • 2 comments

When doing testing it would be very useful to have docker-client changing relative bind mount paths to absolute paths as docker only allows absolute paths while people using docker-client may be running it from different project dirs

My suggestion would be that when using loadCompose and option could be to convert the relative volume paths to absolute ones based on the work dir

Example when workdir is /path/to/project/root

    volumes:
      - "./build/data:/data" 

becomes

    volumes:
      - "/path/to/project/root/./build/data:/data" 

tobad357 avatar Aug 28 '17 07:08 tobad357

Your example "/path/to/project/root/./build/data:/data" would be a simple String concatenation. Do you think using Paths to resolve the absolute directory would be even better?

gesellix avatar Aug 28 '17 08:08 gesellix

I'm not sure if resolving would work as it could be deployed on a remote swarm node So maybe just creating a proper path but not caring if it exists or not?

tobad357 avatar Aug 29 '17 05:08 tobad357