1

Let's say I have started my containers with:

docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml up --build

Is there a way to lookup, for a given running container, what the command was that started it? Something (pseudocode) like docker origin-command <container id> or similar?

Thijs
  • 647
  • 5
  • 15
  • 1
    This might be helpful: https://stackoverflow.com/questions/32758793/how-to-show-the-run-command-of-a-docker-container – blasrodri Apr 01 '19 at 12:12
  • What exactly are you looking to find out? This might help: "docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml config" => it will show you the final merged configuration that will be run by docker-compose – Mihai Apr 02 '19 at 04:33

1 Answers1

1

sure you can. use the inspect docker command:

docker container inspect <container_id>

this command will output a huge json object, what you need is under Config.CMD which appears to be an array containing the container entrypoint command and its flags.

Efrat Levitan
  • 5,181
  • 2
  • 19
  • 40