shibli049
shibli049's Blog

shibli049's Blog

Find the docker-compose working directory

Find the docker-compose working directory

shibli049's photo
shibli049
·May 6, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

I use docker-compose to prepare my dev environment, e.g database, redis, etc. And, sometimes, I forget the location of the docker-compose file. Or, which docker-compose file I used, so here's the trick to find the compose file location of a running container:

docker inspect {your_container_name}| grep working

Or, if you can’t remember the container name:

# to find the container id  
docker ps

# then
docker inspect {your_container_id}| grep working

And, you’ll get an output like the below.

"com.docker.compose.project.working_dir": "/mnt/docker-compose/file-location",

You’ll find the docker-compose file under /mnt/docker-compose/file-location folder.

 
Share this