github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/man/docker-config-json.5.md (about)

     1  % CONFIG.JSON(5) Docker User Manuals
     2  % Docker Community
     3  % JANUARY 2016
     4  # NAME
     5  HOME/.docker/config.json - Default Docker configuration file
     6  
     7  # INTRODUCTION
     8  
     9  By default, the Docker command line stores its configuration files in a
    10  directory called `.docker` within your `$HOME` directory.  Docker manages most of
    11  the files in the configuration directory and you should not modify them.
    12  However, you *can modify* the `config.json` file to control certain aspects of
    13  how the `docker` command behaves.
    14  
    15  Currently, you can modify the `docker` command behavior using environment
    16  variables or command-line options. You can also use options within
    17  `config.json` to modify some of the same behavior. When using these
    18  mechanisms, you must keep in mind the order of precedence among them. Command
    19  line options override environment variables and environment variables override
    20  properties you specify in a `config.json` file.
    21  
    22  The `config.json` file stores a JSON encoding of several properties:
    23  
    24  * The `HttpHeaders` property specifies a set of headers to include in all messages
    25  sent from the Docker client to the daemon. Docker does not try to interpret or
    26  understand these header; it simply puts them into the messages. Docker does not
    27  allow these headers to change any headers it sets for itself.
    28  
    29  * The `psFormat` property specifies the default format for `docker ps` output.
    30  When the `--format` flag is not provided with the `docker ps` command,
    31  Docker's client uses this property. If this property is not set, the client
    32  falls back to the default table format. For a list of supported formatting
    33  directives, see **docker-ps(1)**.
    34  
    35  * The `detachKeys` property specifies the default key sequence which
    36  detaches the container. When the `--detach-keys` flag is not provide
    37  with the `docker attach`, `docker exec`, `docker run` or `docker
    38  start`, Docker's client uses this property. If this property is not
    39  set, the client falls back to the default sequence `ctrl-p,ctrl-q`.
    40  
    41  
    42  * The `imagesFormat` property  specifies the default format for `docker images`
    43  output. When the `--format` flag is not provided with the `docker images`
    44  command, Docker's client uses this property. If this property is not set, the
    45  client falls back to the default table format. For a list of supported
    46  formatting directives, see **docker-images(1)**.
    47  
    48  You can specify a different location for the configuration files via the
    49  `DOCKER_CONFIG` environment variable or the `--config` command line option. If
    50  both are specified, then the `--config` option overrides the `DOCKER_CONFIG`
    51  environment variable:
    52  
    53      docker --config ~/testconfigs/ ps
    54  
    55  This command instructs Docker to use the configuration files in the
    56  `~/testconfigs/` directory when running the `ps` command.
    57  
    58  ## Examples
    59  
    60  Following is a sample `config.json` file:
    61  
    62      {
    63        "HttpHeaders": {
    64          "MyHeader": "MyValue"
    65        },
    66        "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
    67        "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
    68        "detachKeys": "ctrl-e,e"
    69      }
    70  
    71  # HISTORY
    72  January 2016, created by Moxiegirl <mary@docker.com>