Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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" 
like image 581
apil.tamang Avatar asked Oct 31 '16 12:10

apil.tamang


People also ask

What is Depends_on in Docker compose?

depends_on is a Docker Compose keyword to set the order in which services must start and stop. For example, suppose we want our web application, which we'll build as a web-app image, to start after our Postgres container.

What is the format of Docker compose file?

The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml . Tip: You can use either a .yml or .yaml extension for this file. They both work.

How do I validate a docker compose file?

Validating your file now is as simple as docker-compose -f docker-compose. yml config . As always, you can omit the -f docker-compose. yml part when running this in the same folder as the file itself or having the COMPOSE_FILE environment variable pointing to your file.

What is entrypoint Docker compose?

If you look over the Docker documentation, it describes an EntryPoint as: An ENTRYPOINT allows you to configure a container that will run as an executable.


1 Answers

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

like image 157
dnephin Avatar answered Oct 07 '22 12:10

dnephin