Closed lv-zheng closed 8 years ago
Looks good to me
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.
这么一说我突然想到了,直接运行一个bash脚本,和被另外一个bash脚本调用时,路径是怎样的?
印象里我没有直接运行过 jekyll/build.sh
而是通过 utils/prepare.sh
间接调用的
有没有可能是这里导致了差异?
Merged.
Source code is stored under $PWD
. (See genpack.sh
)
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.