github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/config_inspect.md (about)

     1  # config inspect
     2  
     3  <!---MARKER_GEN_START-->
     4  Display detailed information on one or more configs
     5  
     6  ### Options
     7  
     8  | Name                                   | Type     | Default | Description                                                                                                                                                                                                                                                        |
     9  |:---------------------------------------|:---------|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    10  | [`-f`](#format), [`--format`](#format) | `string` |         | Format output using a custom template:<br>'json':             Print in JSON format<br>'TEMPLATE':         Print output using the given Go template.<br>Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates |
    11  | `--pretty`                             |          |         | Print the information in a human friendly format                                                                                                                                                                                                                   |
    12  
    13  
    14  <!---MARKER_GEN_END-->
    15  
    16  ## Description
    17  
    18  Inspects the specified config.
    19  
    20  By default, this renders all results in a JSON array. If a format is specified,
    21  the given template will be executed for each result.
    22  
    23  Go's [text/template](https://pkg.go.dev/text/template) package
    24  describes all the details of the format.
    25  
    26  For detailed information about using configs, refer to [store configuration data using Docker Configs](https://docs.docker.com/engine/swarm/configs/).
    27  
    28  > **Note**
    29  >
    30  > This is a cluster management command, and must be executed on a Swarm
    31  > manager node. To learn about managers and workers, refer to the
    32  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    33  > documentation.
    34  
    35  ## Examples
    36  
    37  ### Inspect a config by name or ID
    38  
    39  You can inspect a config, either by its *name*, or *ID*
    40  
    41  For example, given the following config:
    42  
    43  ```console
    44  $ docker config ls
    45  
    46  ID                          NAME                CREATED             UPDATED
    47  eo7jnzguqgtpdah3cm5srfb97   my_config           3 minutes ago       3 minutes ago
    48  ```
    49  
    50  ```console
    51  $ docker config inspect config.json
    52  ```
    53  
    54  The output is in JSON format, for example:
    55  
    56  ```json
    57  [
    58    {
    59      "ID": "eo7jnzguqgtpdah3cm5srfb97",
    60      "Version": {
    61        "Index": 17
    62      },
    63      "CreatedAt": "2017-03-24T08:15:09.735271783Z",
    64      "UpdatedAt": "2017-03-24T08:15:09.735271783Z",
    65      "Spec": {
    66        "Name": "my_config",
    67        "Labels": {
    68          "env": "dev",
    69          "rev": "20170324"
    70        },
    71        "Data": "aGVsbG8K"
    72      }
    73    }
    74  ]
    75  ```
    76  
    77  ### <a name="format"></a> Format the output (--format)
    78  
    79  You can use the --format option to obtain specific information about a
    80  config. The following example command outputs the creation time of the
    81  config.
    82  
    83  ```console
    84  $ docker config inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
    85  
    86  2017-03-24 08:15:09.735271783 +0000 UTC
    87  ```
    88  
    89  ## Related commands
    90  
    91  * [config create](config_create.md)
    92  * [config ls](config_ls.md)
    93  * [config rm](config_rm.md)