Score:0

Starting Directory for Bash

in flag

I've a Docker container running. I connect to the container using a command like:

docker exec -it container_name bash

This logs in as root at /var/www/html. I want to know why this directory, and how I would go about changing it. This is actually a web application's container and I do want to start in the web applications content root, but that's on a differently named volume defined in the docker-compose.yml file.

I checked .profile and .bashrc and nothing seems to indicate that it would start in this directory and be obvious to change.

Score:1
jp flag

The working directory in a container is specified with WORKDIR instruction in Dockerfile. You can also change the working by specifying -w parameter for docker run or with working_dir attribute in docker-compose.yml.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.