components/docker/files/man/config-json.5
changeset 6468 af5d82385cd7
equal deleted inserted replaced
6467:e5632698211d 6468:af5d82385cd7
       
     1 .TH "CONFIG.JSON" "5" " Docker User Manuals" "Docker Community" "JANUARY 2016"  ""
       
     2 
       
     3 
       
     4 .SH NAME
       
     5 .PP
       
     6 HOME/.docker/config.json \- Default Docker configuration file
       
     7 
       
     8 
       
     9 .SH INTRODUCTION
       
    10 .PP
       
    11 By default, the Docker command line stores its configuration files in a
       
    12 directory called \fB\fC.docker\fR within your \fB\fCHOME\fR directory.  Docker manages most of
       
    13 the files in the configuration directory and you should not modify them.
       
    14 However, you \fIcan modify\fP the \fB\fCconfig.json\fR file to control certain aspects of
       
    15 how the \fB\fCdocker\fR command behaves.
       
    16 
       
    17 .PP
       
    18 Currently, you can modify the \fB\fCdocker\fR command behavior using environment
       
    19 variables or command\-line options. You can also use options within
       
    20 \fB\fCconfig.json\fR to modify some of the same behavior. When using these
       
    21 mechanisms, you must keep in mind the order of precedence among them. Command
       
    22 line options override environment variables and environment variables override
       
    23 properties you specify in a \fB\fCconfig.json\fR file.
       
    24 
       
    25 .PP
       
    26 The \fB\fCconfig.json\fR file stores a JSON encoding of several properties:
       
    27 .IP \n+[step]
       
    28 
       
    29 \item 
       
    30 .PP
       
    31 The \fB\fCHttpHeaders\fR property specifies a set of headers to include in all messages
       
    32 sent from the Docker client to the daemon. Docker does not try to interpret or
       
    33 understand these header; it simply puts them into the messages. Docker does not
       
    34 allow these headers to change any headers it sets for itself.
       
    35 \item 
       
    36 .PP
       
    37 The \fB\fCpsFormat\fR property specifies the default format for \fB\fCdocker ps\fR output.
       
    38 When the \fB\fC\-\-format\fR flag is not provided with the \fB\fCdocker ps\fR command,
       
    39 Docker's client uses this property. If this property is not set, the client
       
    40 falls back to the default table format. For a list of supported formatting
       
    41 directives, see \fBdocker\-ps(1)\fP.
       
    42 \item 
       
    43 .PP
       
    44 The \fB\fCdetachKeys\fR property specifies the default key sequence which
       
    45 detaches the container. When the \fB\fC\-\-detach\-keys\fR flag is not provide
       
    46 with the \fB\fCdocker attach\fR, \fB\fCdocker exec\fR, \fB\fCdocker run\fR or \fB\fCdocker
       
    47 start\fR, Docker's client uses this property. If this property is not
       
    48 set, the client falls back to the default sequence \fB\fCctrl\-p,ctrl\-q\fR.
       
    49 \item 
       
    50 .PP
       
    51 The \fB\fCimagesFormat\fR property  specifies the default format for \fB\fCdocker images\fR
       
    52 output. When the \fB\fC\-\-format\fR flag is not provided with the \fB\fCdocker images\fR
       
    53 command, Docker's client uses this property. If this property is not set, the
       
    54 client falls back to the default table format. For a list of supported
       
    55 formatting directives, see \fBdocker\-images(1)\fP.
       
    56 .PP
       
    57 You can specify a different location for the configuration files via the
       
    58 \fB\fCDOCKER\_CONFIG\fR environment variable or the \fB\fC\-\-config\fR command line option. If
       
    59 both are specified, then the \fB\fC\-\-config\fR option overrides the \fB\fCDOCKER\_CONFIG\fR
       
    60 environment variable:
       
    61 
       
    62 .PP
       
    63 .RS
       
    64 
       
    65 .nf
       
    66 docker \-\-config \~/testconfigs/ ps
       
    67 
       
    68 .fi
       
    69 .RE
       
    70 
       
    71 .PP
       
    72 This command instructs Docker to use the configuration files in the
       
    73 \fB\fC\~/testconfigs/\fR directory when running the \fB\fCps\fR command.
       
    74 
       
    75 .SH Examples
       
    76 .PP
       
    77 Following is a sample \fB\fCconfig.json\fR file:
       
    78 
       
    79 .PP
       
    80 .RS
       
    81 
       
    82 .nf
       
    83 {
       
    84   "HttpHeaders": {
       
    85     "MyHeader": "MyValue"
       
    86   },
       
    87   "psFormat": "table {{.ID}}\\\\t{{.Image}}\\\\t{{.Command}}\\\\t{{.Labels}}",
       
    88   "imagesFormat": "table {{.ID}}\\\\t{{.Repository}}\\\\t{{.Tag}}\\\\t{{.CreatedAt}}",
       
    89   "detachKeys": "ctrl\-e,e"
       
    90 }
       
    91 
       
    92 .fi
       
    93 .RE
       
    94 
       
    95 
       
    96 .SH HISTORY
       
    97 .PP
       
    98 January 2016, created by Moxiegirl 
       
    99 \[la][email protected]\[ra]