1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<h1>docker config inspect</h1> <p><br></p> <p>Display detailed information on one or more configs</p> <p><span class="badge badge-info" data-toggle="tooltip" data-placement="right" title="This command works with the Swarm orchestrator.">Swarm</span> This command works with the Swarm orchestrator.</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker config inspect [OPTIONS] CONFIG [CONFIG...]
</pre></div> <p>Refer to the <a href="#options">options section</a> for an overview of available <a href="#options"><code class="language-plaintext highlighter-rouge">OPTIONS</code></a> for this command.</p> <h2 id="description">Description</h2> <p name="extended-description">Inspects the specified config.</p> <p>By default, this renders all results in a JSON array. If a format is specified, the given template will be executed for each result.</p> <p>Go’s <a href="https://golang.org/pkg/text/template/">text/template</a> package describes all the details of the format.</p> <p>For detailed information about using configs, refer to <a href="../../../swarm/configs/index">store configuration data using Docker Configs</a>.</p> <blockquote> <p><strong>Note</strong></p> <p>This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the <a href="../../../swarm/index">Swarm mode section</a> in the documentation.</p> </blockquote> <p>For example uses of this command, refer to the <a href="#examples">examples section</a> below.</p> <h2 id="options">Options</h2> <table> <thead> <tr> <td>Name, shorthand</td> <td>Default</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>
<code class="language-plaintext highlighter-rouge">--format</code> , <code class="language-plaintext highlighter-rouge">-f</code>
</td> <td></td> <td>Format the output using the given Go template</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--pretty</code></td> <td></td> <td>Print the information in a human friendly format</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <h3 id="inspect-a-config-by-name-or-id">Inspect a config by name or ID</h3> <p>You can inspect a config, either by its <em>name</em>, or <em>ID</em></p> <p>For example, given the following config:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker config ls
ID NAME CREATED UPDATED
eo7jnzguqgtpdah3cm5srfb97 my_config 3 minutes ago 3 minutes ago
</pre></div> <div class="highlight"><pre class="highlight" data-language="">$ docker config inspect config.json
</pre></div> <p>The output is in JSON format, for example:</p> <div class="highlight"><pre class="highlight" data-language="">[
{
"ID": "eo7jnzguqgtpdah3cm5srfb97",
"Version": {
"Index": 17
},
"CreatedAt": "2017-03-24T08:15:09.735271783Z",
"UpdatedAt": "2017-03-24T08:15:09.735271783Z",
"Spec": {
"Name": "my_config",
"Labels": {
"env": "dev",
"rev": "20170324"
},
"Data": "aGVsbG8K"
}
}
]
</pre></div> <h3 id="formatting">Formatting</h3> <p>You can use the --format option to obtain specific information about a config. The following example command outputs the creation time of the config.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker config inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
2017-03-24 08:15:09.735271783 +0000 UTC
</pre></div> <h2 id="parent-command">Parent command</h2> <table> <thead> <tr> <th style="text-align: left">Command</th> <th style="text-align: left">Description</th> </tr> </thead> <tbody> <tr> <td style="text-align: left"><a href="../config/index">docker config</a></td> <td style="text-align: left">Manage Docker configs</td> </tr> </tbody> </table> <h2 id="related-commands">Related commands</h2> <table> <thead> <tr> <td>Command</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td><a href="../config_create/index">docker config create</a></td> <td>Create a config from a file or STDIN</td> </tr> <tr> <td><a href="index">docker config inspect</a></td> <td>Display detailed information on one or more configs</td> </tr> <tr> <td><a href="../config_ls/index">docker config ls</a></td> <td>List configs</td> </tr> <tr> <td><a href="../config_rm/index">docker config rm</a></td> <td>Remove one or more configs</td> </tr> </tbody> </table> <div class="_attribution">
<p class="_attribution-p">
© 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br>
<a href="https://docs.docker.com/engine/reference/commandline/config_inspect/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/config_inspect/</a>
</p>
</div>
|