You can print most of this information by looking at the output of docker inspect .
For example, you can open a command running inside a container by looking at the Config.Cmd key. If I run:
$ docker run -v /tmp/data:/data --name sleep -it --rm alpine sleep 600
I can run later:
$ docker inspect --format '{{.Config.Cmd}}' sleep
And we get:
{[sleep 600]}
Similarly, the output of docker inspect will also contain information about the Docker volumes used in the container:
$ docker inspect --format '{{.Volumes}}' sleep map[/data:/tmp/data]
Of course, you can simply run docker inspect without --format , which will give you a large (100+ lines) fragment of JSON output containing all the available keys, which includes information about port mappings, network configuration, etc.
source share