docker inspect : Gets the metadata of the container / mirror. OPTIONS description: -f : Specifies the template file for the return value. -s : Displays the total file size. –type : Returns JSON for the specified type. Gets the meta-information of the mirror mysql:5.6. Gets the IP of the running container mymysql. 2.38.1. Grammar ¶
docker inspect [OPTIONS] NAME|ID [NAME|ID...]
2.38.2. Example ¶
runoob@runoob:~$ 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": {}
},
...
runoob@runoob:~$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mymysql
172.17.0.3