只是想知道work_dir文件对于通过docker-compose加载的图像真正起了什么作用。示例docker-compose.yml文件如下:
dev:
extends:
file: common.yml
service: workspace
volumes:
- $ATOMSPACE_SOURCE_DIR:/atomspace
- $COGUTILS_SOURCE_DIR:/cogutils
# Uncomment the following lines if you want to work on moses
# - $MOSES_SOURCE_DIR:/moses
working_dir: /opencog # This is the same as the volume mount point below
links:
- postgres:db
- relex:relex
postgres:
image: opencog/postgres
# Uncomment the following lines if you want to work on a production
# system.
# NOTE: The environment variable `PROD` is set `True` then the entrypoint
# script in opencog/postgres does additional configurations.
# environment:
# - PROD=True
relex:
image: opencog/relex
command: /bin/sh -c "./opencog-server.sh"
答案 0 :(得分:8)
working_dir
设置创建的容器的工作目录。它与--workdir
的{{1}}标志相同。