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