Files
docker-docs/machine/reference/inspect.md
Sebastiaan van Stijn 03d60f916a Replace "hide_from_sitemap" with "sitemap: false"
The `hide_from_sitemap` metadata variable was a custom thing we implemented
to add a "noindex" meta-header to pages and to exclude a page from the
search auto-complete.

However, pages with that option set would still be included in sitemap.xml,
resulting in search engines to visit those pages (only to discover they
should not index them).

This patch replaces the custom `hide_from_sitemap` value for `sitemap: false`,
which is a metadata variable that's defined by the "jekyll-sitemap" plugin
we use to generate the sitemap.xml;

https://github.com/jekyll/jekyll-sitemap/blob/v1.4.0/README.md#exclusions

Setting this variable will now:

- add a "noindex" metadata header to the page
- exclude the page from the sitemap.xml.
- exclude the page from /js/metadata.json (used for search autocomplete)

Also fixed an issue in the metadata.json where the `notoc` metadata was
used to exclude pages, however that variable is meant to disable the
in-page TOC (right-hand side navigation with anchor links).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-21 15:09:11 +02:00

2.8 KiB

description, keywords, title, sitemap
description keywords title sitemap
Inspect information about a machine machine, inspect, subcommand docker-machine inspect false
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 renders information about a machine as JSON. If a format is specified, the given template is 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.

{% raw %}

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

192.168.5.99

{% endraw %}

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:

{% raw %}

$ 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
}
{% endraw %}