1CONFIG.JSON(5)(Docker)                                  CONFIG.JSON(5)(Docker)
2
3
4
5Docker Community JANUARY 2016
6
7

NAME

9       HOME/.docker/config.json - Default Docker configuration file
10
11
12

INTRODUCTION

14       By default, the Docker command line stores its configuration files in a
15       directory called .docker within your $HOME directory.   Docker  manages
16       most  of  the  files  in the configuration directory and you should not
17       modify them.  However, you can modify the config.json file  to  control
18       certain aspects of how the docker command behaves.
19
20
21       Currently, you can modify the docker command behavior using environment
22       variables or command-line options. You can also use options within con‐
23       fig.json  to  modify some of the same behavior. When using these mecha‐
24       nisms, you must keep in mind the order of precedence among  them.  Com‐
25       mand  line options override environment variables and environment vari‐
26       ables override properties you specify in a config.json file.
27
28
29       The config.json file stores a JSON encoding of several properties:
30
31
32              · The HttpHeaders property specifies a set of headers to include
33                in  all  messages  sent  from the Docker client to the daemon.
34                Docker does not try to interpret or understand  these  header;
35                it  simply  puts them into the messages. Docker does not allow
36                these headers to change any headers it sets for itself.
37
38              · The psFormat property specifies the default format for  docker
39                ps  output.   When  the --format flag is not provided with the
40                docker ps command, Docker's client uses this property. If this
41                property  is not set, the client falls back to the default ta‐
42                ble format. For a list of supported formatting directives, see
43                docker-ps(1).
44
45              · The  detachKeys  property  specifies  the default key sequence
46                which detaches the container. When the --detach-keys  flag  is
47                not provide with the docker attach, docker exec, docker run or
48                docker start, Docker's client  uses  this  property.  If  this
49                property  is  not  set,  the  client falls back to the default
50                sequence ctrl-p,ctrl-q.
51
52              · The imagesFormat property  specifies the  default  format  for
53                docker  images  output. When the --format flag is not provided
54                with the docker images  command,  Docker's  client  uses  this
55                property.  If  this property is not set, the client falls back
56                to the default table format. For a list of  supported  format‐
57                ting directives, see docker-images(1).
58
59
60
61       You  can  specify  a different location for the configuration files via
62       the DOCKER_CONFIG environment variable or  the  --config  command  line
63       option.  If  both are specified, then the --config option overrides the
64       DOCKER_CONFIG environment variable:
65
66
67              docker --config  /testconfigs/ ps
68
69
70
71       This command instructs Docker to use the  configuration  files  in  the
72       /testconfigs/ directory when running the ps command.
73
74

Examples

76       Following is a sample config.json file:
77
78
79              {
80                "HttpHeaders": {
81                  "MyHeader": "MyValue"
82                },
83                "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
84                "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
85                "detachKeys": "ctrl-e,e"
86              }
87
88
89
90

HISTORY

92       January      2016,     created     by     Moxiegirl     mary@docker.com
93       ⟨mailto:mary@docker.com⟩
94
95
96
97Manuals                              User               CONFIG.JSON(5)(Docker)
Impressum