curl command for docker inspect

I have seen some curl commands to search, pull image etc from docker. Some examples are provided here

What is the equalent code of sudo docker inspect nginx?

  • Limit USB devices exposed to docker
  • openssh-server doesn't start in Docker container
  • Change IP address pool of docker bridge
  • docker deploy won't publish port in swarm
  • Docker Container Version Control
  • Nvidia Theano docker image not available
  • In terminal its output is as follows.

    [
    {
        "Id": "319d2015d149943ff4d2a20ddea7d7e5ce06a64bbab1792334c0d3273bbbff1e",
        "Parent": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
        "Comment": "",
        "Created": "2015-06-16T21:50:45.835843344Z",
        "Container": "e9b1150a37d45ba2335ee36436e7d435c1ce1d2960720cd1d06c194c2db13d8f",
        "ContainerConfig": {
            "Hostname": "6c732c6044b7",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "PortSpecs": null,
            "ExposedPorts": {
                "443/tcp": {},
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NGINX_VERSION=1.9.2-1~jessie"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) CMD [\"nginx\" \"-g\" \"daemon off;\"]"
            ],
            "Image": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
            "Volumes": {
                "/var/cache/nginx": {}
            },
            "VolumeDriver": "",
            "WorkingDir": "",
            "Entrypoint": null,
            "NetworkDisabled": false,
            "MacAddress": "",
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "1.6.0",
        "Author": "NGINX Docker Maintainers \"docker-maint@nginx.com\"",
        "Config": {
            "Hostname": "6c732c6044b7",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "PortSpecs": null,
            "ExposedPorts": {
                "443/tcp": {},
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NGINX_VERSION=1.9.2-1~jessie"
            ],
            "Cmd": [
                "nginx",
                "-g",
                "daemon off;"
            ],
            "Image": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
            "Volumes": {
                "/var/cache/nginx": {}
            },
            "VolumeDriver": "",
            "WorkingDir": "",
            "Entrypoint": null,
            "NetworkDisabled": false,
            "MacAddress": "",
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 0,
        "VirtualSize": 132841390
    }
    ]
    

  • Does docker verify images? If so, how is it implemented?
  • How to get Docker metrics using docker remote API
  • How to set Docker ENTRYPOINT To NPM?
  • Do Docker support 32 bit ubuntu(12.04) or suse OS in future?
  • “Service cron status” command does not give back the status of cron in the ubuntu docker container
  • Docker-compose service with --service-ports flag as default
  • One Solution collect form web for “curl command for docker inspect”

    Any docker command ( docker ps, docker stats…) is a call to the API. From the latest 1.7 doc https://docs.docker.com/reference/api/docker_remote_api_v1.17/ I see

    Inspect a container

    GET /containers/(id)/json
    

    Return low-level information on the container id

    Example request:

    GET /containers/4fa6e0f0c678/json HTTP/1.1
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.