sjtug / mirror-docker

Dockerfile for SJTUG mirror
https://mirrors.sjtug.sjtu.edu.cn
GNU Affero General Public License v3.0
31 stars 6 forks source link

fix jekyll build.sh relative path issue #19

Closed lv-zheng closed 8 years ago

lv-zheng commented 8 years ago

When I tried deploying the containers on mirrors.sjtug.org server, docker gave the following error message:

docker: Error response from daemon: create ./mirror-web: volume name invalid: "./mirror-web" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. See 'docker run --help'.

Docker didn't seem to accept relative path for host directory. This trouble should be caused by using different versions of docker in development and deployment.

To fix this, use $PWD to get the absolute path instead.

Endle commented 8 years ago

Looks good to me

htfy96 commented 8 years ago

docker-compose would translate relative path to absolute one, and docker itself only accepts absolute path.

~ However, dirname $0 might be a better solution compared to $PWD. Could you test it on the server? ~

Update: $PWD is the correct place because genpack.sh stores source code under it.

Endle commented 8 years ago

这么一说我突然想到了,直接运行一个bash脚本,和被另外一个bash脚本调用时,路径是怎样的? 印象里我没有直接运行过 jekyll/build.sh 而是通过 utils/prepare.sh 间接调用的 有没有可能是这里导致了差异?

htfy96 commented 8 years ago

Merged. Source code is stored under $PWD. (See genpack.sh)