1

I want to see the command prompt used to trigger a python script inside a docker container. The process that is running can only be stopped if there is a dire need.

Is there any way I can see what was command line that was used?

To attach to the docker container I use this command.

docker attach [OPTIONS] CONTAINER

Thank you in advance.

RustyShackleford
  • 3,462
  • 9
  • 40
  • 81
  • Maybe a duplicate of this question: https://stackoverflow.com/questions/32758793/how-to-show-the-run-command-of-a-docker-container/32774347 ? – Marcus Held Apr 25 '19 at 04:13

2 Answers2

2

You can use:

docker exec -it CONTAINER ps aux 

to see the process which is running in container

Thanh Nguyen Van
  • 10,292
  • 6
  • 35
  • 53
1

You can see the docker logs for the same. sudo docker logs ContainerID/image_name:tag

rolling logs sudo docker logs -f ContainerID/image_name:tag

ShubhJ
  • 7
  • 2