What Does Working_Dir Tag Mean in a Docker-Compose Yml File

Just wondering what the working_dir file really does for an image being loaded via docker-compose. A sample docker-compose.yml file as follows:

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"
1

1 Answer

working_dir sets the working directory of the container that is created. It is the same as the --workdir flag to docker run.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest