1CONFIG.JSON(5)                Docker User Manuals               CONFIG.JSON(5)
2
3
4

NAME

6       HOME/.docker/config.json - Default Docker configuration file
7
8
9

INTRODUCTION

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

Examples

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

HISTORY

89       January      2016,     created     by     Moxiegirl     mary@docker.com
90       ⟨mailto:mary@docker.com⟩
91
92
93
94Docker Community                 JANUARY 2016                   CONFIG.JSON(5)
Impressum