docker inspect command

[[email protected] ~]# docker inspect --help

Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects

Options:
-f, --format string Format the output using the given Go template
--help Print usage
-s, --size Display total file sizes if the type is container
--type string Return JSON for specified type

[[email protected] ~]# sudo docker inspect 27150dc6e94b
[
    {
        "Id": "27150dc6e94bae0ed89a02f57e132906491ad6b578fc096585cb220eb29a9773",
        "Created": "2018-06-04T06:04:39.592820956Z",
        "Path": "/bin/bash",
        "Args": [],
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-06-04T06:04:39.94807597Z",
            "FinishedAt": "2018-06-04T06:04:40.041887322Z"
        },
        "Image": "sha256:44ae5d2a191e49f4a4de97a8b3e50049333d64e283bb2aa397815bbe01398a24",
        "ResolvConfPath": "/var/lib/docker/containers/27150dc6e94bae0ed89a02f57e132906491ad6b578fc096585cb220eb29a9773/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/27150dc6e94bae0ed89a02f57e132906491ad6b578fc096585cb220eb29a9773/hostname",
        "HostsPath": "/var/lib/docker/containers/27150dc6e94bae0ed89a02f57e132906491ad6b578fc096585cb220eb29a9773/hosts",
        "LogPath": "",
        "Name": "/stoic_ardinghelli",
        "RestartCount": 0,
        "Driver": "overlay2",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "journald",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "docker-runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Name": "overlay2",
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/e1a3fb79aa2001dac6ad9fc8639e232e4f3cffcce20a8fb3edbf1ffd417fa2f3-init/diff:/var/lib/docker/overlay2/d736280cbbf1b67bf15ce793229c7115449459fd1b8172235694dfb0ac59e622/diff:/var/lib/docker/overlay2/b15fcb1d0975f70be3e93244951dfa4357c60bb95236ce3d3a1d27be1e990d1d/diff:/var/lib/docker/overlay2/9bad79c95f340475e2e83ff964613590f6281f197ad2c8dcf606c93965e692cd/diff:/var/lib/docker/overlay2/f2de74cdf4e2065335a6e7d1bb3d8955fbafde138ecd2f0f6fb62f1bb6bedb9a/diff",
                "MergedDir": "/var/lib/docker/overlay2/e1a3fb79aa2001dac6ad9fc8639e232e4f3cffcce20a8fb3edbf1ffd417fa2f3/merged",
                "UpperDir": "/var/lib/docker/overlay2/e1a3fb79aa2001dac6ad9fc8639e232e4f3cffcce20a8fb3edbf1ffd417fa2f3/diff",
                "WorkDir": "/var/lib/docker/overlay2/e1a3fb79aa2001dac6ad9fc8639e232e4f3cffcce20a8fb3edbf1ffd417fa2f3/work"
            }
        },
        "Mounts": [],
        "Config": {
            "Hostname": "27150dc6e94b",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": [
                "/bin/bash"
            ],
            "Image": "ubuntu:14.04.2",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "5d908d49cf3a2295cf79ea9311c7424cfb18ae204f042924951b942ceb5545bf",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": null,
            "SandboxKey": "/var/run/docker/netns/5d908d49cf3a",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "3faaa1380970f952b59fea38ad8073214a404109351a56d5ce626ba12416266b",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": ""
                }
            }
        }
    }
]

#inspecting the container‘s pid
sudo docker inspect -f {{.State.Pid}} 27150dc6e94b

原文地址:http://blog.51cto.com/huwho/2124534

时间: 2024-09-29 14:01:23

docker inspect command的相关文章

docker [OPTIONS] COMMAND

Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string      Location of client config files (default "/home/sinao/.docker") -D, --debug              Enable debug mode -H, --host list          Daemon soc

k8s 传参给docker env command、args和dockerfile中的entrypoint、cmd之间的关系

[k8s]args指令案例-彻底理解docker entrypoint 需求: 搞个镜像,可以运行java -jar xxx.jar包,xxx.jar包名称要用参数传 思路1: 打对应运行jar包的jdk的image. 思路2: 打通用jdk 1, 运行指定jar的指定版的jdk k8s运行该image遇到的问题 kubectl create -f sms.yaml时报 rpc error: code = 2 desc = failed to start container "cffbbc3d2

Self-Paced Training (3) - Docker Operations

AgendaTroubleshooting ContainersOverview of Security PracticesPrivate RegistryIntro to Docker MachineIntro to Docker SwarmIntro to Docker ComposeBuilding micro service applications with Docker Container loggingView the output of the containers PID 1

docker offical docs:Working with Containers

enough ---------------------------------------------------------------------------------- Working with Containers - In the last section of the Docker User Guide we launched our first containers. We launched two containers using the docker run command

Linking Containers Together

Linking Containers Together In the Using Docker section we touched on connecting to a service running inside a Docker container via a network port. This is one of the ways that you can interact with services and applications running inside Docker con

The base command for the Docker CLI.

Description Child commands Command Description docker attach Attach local standard input, output, and error streams to a running container docker build Build an image from a Dockerfile docker checkpoint Manage checkpoints docker commit Create a new i

这20个Docker Command,有几个是你会的?

在这之前呢,也写过两篇关于Docker基础入门类的文章 Docker容器技术入门(一) Docker容器技术入门(二) 很多人都感觉这文章这么简单.这么基础,可是别忘记了"万丈高楼平地起",如果少了这个平地址,你这高楼估计也起不了.所以,基础是学习任何一门技术或者一个技术点的重中之重,也可以说是很关键的决胜点. 所以呢,今天,民工哥给大家总结了这20个Docker Command,愿各位小伙伴在通往"玩转Docker"路上不再无助!!!! 安装完成docker容器服

Docker command learning

docker run -d -p 80:80 nginx ---启动一个容器 docker images\image list\image ls 查看本地镜像 docker rm docker ps -a -q 删除运行的镜像 docker rm ID/NAME 删除容器-运行中的无法删除 docker ps -a 查看已经创建的容器 docker search centos 查询公共可用仓库 docker search alpine -查询镜像 docker pull centos 下载镜像

Learning docker--Chapter2--Handling Docker Containers

Content: (1)    Clarifying the Docker terms (2)    Working with the Docker images and containers (3)    The Docker Hub Registry (4)    Searching the Docker images (5)    Working with an interactive container (6)    Tracking the changes inside the con