dockerdocker-compose

Get docker-compose.yml file location from running container?


I have a few running docker containers created by executing docker-compose up.

Is there any way to get the exact file path of the corresponding docker-compose.yml file used to start these containers, just by inspecting the running containers?

As far as I can see, docker inspect CONTAINER_NAME does not provide this information, nor does docker-compose provide a method to get compose-related information from a running container.

What I'd like to do in a script:


Solution

  • It is not currently possible.

    As an alternative might find the following helpful: