Docker Community Forums

Share and learn in the Docker community.

Get docker run command for a container


(Pmcgrath) #1

I know I can get most if not all of this information by doing a

docker inspect $cid

but i would like to get the actual run command that was used to run the container.
I could not see this in any log file, anyone know if this is logged anywhere ?

Thanks in advance
Pat


(Ranjandas) #2

Hi,

You wont get the exact full command including volumes, port mappings and other options passed to docker run from docker inspect in a single line. You will have to extract this information from the json returned from docker inspect and frame the full docker run command used.

Regards