You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.
When trying to define Windows paths for volumes in docker-compose.config.sh and use them dynamically in docker-compose.yml, with this syntax:
volumes:
- "$DOCKER_WWW_ROOT:/var/www"
We're getting this error:
ERROR: for cli Cannot create container for service cli: Invalid volume spec "C": Invalid volume destination path: 'C' mount path must be absolute.
I set out to find how docker-compose resolves the config. In start.sh, I'm adding a "showconf" command:
showconf)
$DOCKER_COMPOSE --verbose config
;;
For this config:
volumes:
- 'd:/Dev/www:/var/www'
# Both variables set to the values show above
- "$DOCKER_WWW_ROOT:$DOCKER_WWW_DEST"
# In Git Bash, that variable is, e.g.: /tmp/ssh-cJ59v8lPx0K4/agent.4640
# (Knowing that Windows doesn't have a "/tmp" path, that's a virtual path of sorts.)
- "$SSH_AUTH_SOCK:/ssh-agent"
docker-compose adds the default ":rw" flag if another one (e.g. ":ro") was not set already.
'd:/Dev/www' gets resolved to /d/Dev/www. Alright.
Apparently in Git Bash the /tmp directory is an alias for ~/AppData/Local/Temp
Finally, Git Bash resolves our $DOCKER_WWW_DEST var as C:/Program Files/Git/var/www/, which is a compatibility feature it has for other reasons. And that's the part that was breaking our config!
So if I change our config to:
volumes:
- "$DOCKER_WWW_ROOT:/var/www"
Everything works fine.
Maybe changing the frontend template to hardcode container-side paths would be enough to fix this?
The text was updated successfully, but these errors were encountered:
To follow up on issues we've discussed with @supasteev0, about user-configurable paths on Windows, we're using:
When trying to define Windows paths for volumes in
docker-compose.config.sh
and use them dynamically indocker-compose.yml
, with this syntax:We're getting this error:
I set out to find how docker-compose resolves the config. In
start.sh
, I'm adding a "showconf" command:For this config:
Once resolved, the config is:
Lessons:
'd:/Dev/www'
gets resolved to/d/Dev/www
. Alright./tmp
directory is an alias for~/AppData/Local/Temp
$DOCKER_WWW_DEST
var asC:/Program Files/Git/var/www/
, which is a compatibility feature it has for other reasons. And that's the part that was breaking our config!So if I change our config to:
Everything works fine.
Maybe changing the frontend template to hardcode container-side paths would be enough to fix this?
The text was updated successfully, but these errors were encountered: