Get Started
About Docker Apply custom metadata Docker Deprecated Features Understand the architecture
Image management
Using certificates for repository client verification Run a local registry mirror
Docker run reference Dockerfile reference Remote API client libraries docker.io accounts API Docker Trusted Registry

inspect

Usage: docker-machine inspect [OPTIONS] [arg...]

Inspect information about a machine

Description:
   Argument is a machine name.

Options:
   --format, -f 	Format the output using the given go template.

By default, this will render information about a machine as JSON. If a format is specified, the given template will be executed for each result.

Go’s text/template package describes all the details of the format.

In addition to the text/template syntax, there are some additional functions, json and prettyjson, which can be used to format the output as JSON (documented below).

Examples

List all the details of a machine:

This is the default usage of inspect.

$ docker-machine inspect dev
{
    "DriverName": "virtualbox",
    "Driver": {
        "MachineName": "docker-host-128be8d287b2028316c0ad5714b90bcfc11f998056f2f790f7c1f43f3d1e6eda",
        "SSHPort": 55834,
        "Memory": 1024,
        "DiskSize": 20000,
        "Boot2DockerURL": "",
        "IPAddress": "192.168.5.99"
    },
    ...
}

Get a machine’s IP address:

For the most part, you can pick out any field from the JSON in a fairly straightforward manner.

$ docker-machine inspect --format='{{.Driver.IPAddress}}' dev
192.168.5.99

Formatting details:

If you want a subset of information formatted as JSON, you can use the json function in the template.

$ docker-machine inspect --format='{{json .Driver}}' dev-fusion
{"Boot2DockerURL":"","CPUS":8,"CPUs":8,"CaCertPath":"/Users/hairyhenderson/.docker/machine/certs/ca.pem","DiskSize":20000,"IPAddress":"172.16.62.129","ISO":"/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso","MachineName":"dev-fusion","Memory":1024,"PrivateKeyPath":"/Users/hairyhenderson/.docker/machine/certs/ca-key.pem","SSHPort":22,"SSHUser":"docker","SwarmDiscovery":"","SwarmHost":"tcp://0.0.0.0:3376","SwarmMaster":false}

While this is usable, it’s not very human-readable. For this reason, there is prettyjson:

$ docker-machine inspect --format='{{prettyjson .Driver}}' dev-fusion
{
    "Boot2DockerURL": "",
    "CPUS": 8,
    "CPUs": 8,
    "CaCertPath": "/Users/hairyhenderson/.docker/machine/certs/ca.pem",
    "DiskSize": 20000,
    "IPAddress": "172.16.62.129",
    "ISO": "/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso",
    "MachineName": "dev-fusion",
    "Memory": 1024,
    "PrivateKeyPath": "/Users/hairyhenderson/.docker/machine/certs/ca-key.pem",
    "SSHPort": 22,
    "SSHUser": "docker",
    "SwarmDiscovery": "",
    "SwarmHost": "tcp://0.0.0.0:3376",
    "SwarmMaster": false
}
On this page:
Sep 18, 2015 at 9:14pm (PST) { "docker/compose": { "ref": "docs", "repos": [ "git@github.com:docker/compose.git" ], "sha": "7a3e4bc0150dc4f06d72dcb07f966cf2b9e9d817" }, "docker/docker": { "ref": "docs", "repos": [ "git@github.com:docker/docker.git" ], "sha": "942363d3ca119c19d82525b4b9e0c65dc35b9359" }, "docker/docker-hub": { "ref": "master", "repos": [ "git@github.com:docker/hub2-demo.git" ], "sha": "afce1a61faf7fe947155d28a2e664d277e976947" }, "docker/docker-trusted-registry": { "ref": "docs", "repos": [ "git@github.com:docker/dhe-deploy.git" ], "sha": "81b18ab1a27313efeb8d3427244344986b52f0cd" }, "docker/docs-base": { "ref": "master", "repos": [ "git@github.com:docker/docs-base.git" ], "sha": "5f2f7a0649adcea1a55182605bb93494f87da7c1" }, "docker/machine": { "ref": "docs", "repos": [ "git@github.com:docker/machine.git" ], "sha": "e919cea54de94d8c4eab8d813151f5be4b1a0aa4" }, "docker/opensource": { "ref": "master", "repos": [ "git@github.com:docker/opensource.git" ], "sha": "c1bbeb9ef713d8d462cf54229b56dba048c716bb" }, "docker/registry": { "ref": "release/2.1", "repos": [ "git@github.com:docker/distribution.git" ], "sha": "9ca7921603852314b18a6ecc19f91806935f34bd" }, "docker/swarm": { "ref": "docs", "repos": [ "git@github.com:docker/swarm.git" ], "sha": "d241eca22dba573394500475923eed6094563ac6" }, "docker/tutorials": { "ref": "docs", "repos": [ "git@github.com:docker/tutorials.git" ], "sha": "76c87ad5a1ac7234b420745cca89a1413076f38d" }, "docs.docker.com": { "ref": "refs/heads/dtr-1.3-release", "repos": [ "git@github.com:moxiegirl/docs.docker.com.git", "git@github.com:docker/docs.docker.com.git" ], "sha": "6b37e676298bfb507e6e412f1f0637dcf7a4138f" }, "kitematic/kitematic": { "ref": "docs", "repos": [ "git@github.com:kitematic/kitematic.git" ], "sha": "7baf7707caf9a797f276e668df8e8e8a203746ee" } }