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?

  • Execute a Firefox Browser in a Docker Container for Selenium testing
  • Docker - Could not load X509 key pair
  • How to push container to Google Container Registry (unable to create repository)
  • docker service create doesn't find image
  • Dockerfile CMD instruction will exit the container just after running it
  • How to edit ENTRYPOINT file of a docker image.
  • 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
    }
    ]
    

  • Zypper repository authentication (non-interactive)
  • How to test queue worker outage and recovery
  • Docker-compose cannot find Java
  • Best Practice to run commands after starting up a prebuilt docker image
  • Docker Machine on Mac: Cannot see mounted Volumes on docker host/docker-machine? Where are volumes physically stored?
  • How to access files downloaded on my windows machine from boot2docker?
  • 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.