I am on a windows host and using git bash. My goal is to create an alias for Jekyll on my git bash: run the docker image instead of installing all the dependencies. I also want to store the "gems" in a local docker volume.
I would like to use the image jekyll/jekyll:stable
and the image has a readme here.
This is the alias that I have in my aliases.sh:
alias jekyll='winpty docker run --rm --volume=$PWD:/srv/jekyll --mount type=volume,src=gems,dst=/usr/gem,volume-driver=local -it jekyll/jekyll:stable'
Issuing jekyll
results in:
docker: Error response from daemon: invalid mount config for type "volume": invalid mount path: 'C:/Program Files/Git/usr/gem' mount path must be absolute. See 'docker run --help'.
I don't understand: I am trying to mount a volume, not a bind mount. I have also tried to use the more simplistic "-v" syntax, same result. Is my docker trying to mount gems as a (directory) bind mount?
I also tried to debug this with bash set -x
, the actual command issued was winpty docker run --rm --volume=/h/:/srv/jekyll --mount type=volume,src=gems,dst=/usr/gem,volume-driver=local -it jekyll/jekyll:stable
which looks OK.
UPDATE: It seems that perhaps the /usr
destination (in container) is being translated as C:/Program Files/Git/usr/gem
which is wrong... I'd need to somehow insert a literal /usr/
in my command.