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:
It is not currently possible.
As an alternative might find the following helpful:
docker ps -a | grep <certain_container>
locate docker-compose.yml
and find the one that you wantdocker-compose restart
(do docker-compose
to see option)