Docker inspect command
docker inspect: Get metadata container / mirror.
grammar
docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...]
OPTIONS Description:
-f: Specifies the return value of the template file.
-s: Displays the total file size.
--type: Returns the specified type JSON.
Examples
Get Mirror mysql: 5.6 meta information.
w3big@w3big:~$ docker inspect mysql:5.6 [ { "Id": "sha256:2c0964ec182ae9a045f866bbc2553087f6e42bfc16074a74fb820af235f070ec", "RepoTags": [ "mysql:5.6" ], "RepoDigests": [], "Parent": "", "Comment": "", "Created": "2016-05-24T04:01:41.168371815Z", "Container": "e0924bc460ff97787f34610115e9363e6363b30b8efa406e28eb495ab199ca54", "ContainerConfig": { "Hostname": "b0cf605c7757", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "3306/tcp": {} }, ...
Get a running container mymysql of IP.
w3big@w3big:~$ docker inspect -f '{{.NetworkSettings.IPAddress}}' mymysql 172.17.0.3