From 408d7deaf79492eea182f94b497b11a406854e0c Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Tue, 28 Apr 2015 08:00:18 -0700 Subject: [PATCH] Add support for DOCKER_CONFIG/--config to specific config file dir Carry #11675 Aside from what #11675 says, to me a key usecase for this is to support more than one Docker cli running at the same time but each may have its own set of config files. Signed-off-by: Doug Davis --- docs/reference/commandline/cli.md | 22 +++++++++++++++++----- docs/reference/commandline/daemon.md | 1 + man/docker.1.md | 3 +++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index 0407c03fc0..69a6e3e31e 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -10,7 +10,7 @@ parent = "smn_cli" # Using the command line -> **Note:** if you are using a remote Docker daemon, such as Boot2Docker, +> **Note:** If you are using a remote Docker daemon, such as Boot2Docker, > then _do not_ type the `sudo` before the `docker` commands shown in the > documentation's examples. @@ -38,6 +38,7 @@ the [installation](/installation) instructions for your operating system. For easy reference, the following list of environment variables are supported by the `docker` command line: +* `DOCKER_CONFIG` The location of your client configuration files. * `DOCKER_CERT_PATH` The location of your authentication keys. * `DOCKER_DRIVER` The graph driver to use. * `DOCKER_HOST` Daemon socket to connect to. @@ -60,10 +61,21 @@ variables. ## Configuration files -The Docker command line stores its configuration files in a directory called -`.docker` within your `HOME` directory. Docker manages most of the files in -`.docker` and you should not modify them. However, you *can modify* the -`.docker/config.json` file to control certain aspects of how the `docker` +By default, the Docker command line stores its configuration files in a +directory called `.docker` within your `HOME` directory. However, you can +specify a different location via the `DOCKER_CONFIG` environment variable +or the `--config` command line option. If both are specified, then the +`--config` option overrides the `DOCKER_CONFIG` environment variable. +For example: + + docker --config ~/testconfigs/ ps + +Instructs Docker to use the configuration files in your `~/testconfigs/` +directory when running the `ps` command. + +Docker manages most of the files in the configuration directory +and you should not modify them. However, you *can modify* the +`config.json` file to control certain aspects of how the `docker` command behaves. Currently, you can modify the `docker` command behavior using environment diff --git a/docs/reference/commandline/daemon.md b/docs/reference/commandline/daemon.md index 84648e8306..668fbc3152 100644 --- a/docs/reference/commandline/daemon.md +++ b/docs/reference/commandline/daemon.md @@ -18,6 +18,7 @@ parent = "smn_cli" --api-cors-header="" Set CORS headers in the remote API -b, --bridge="" Attach containers to a network bridge --bip="" Specify network bridge IP + --config=~/.docker Location of client config files -D, --debug=false Enable debug mode -d, --daemon=false Enable daemon mode --default-gateway="" Container default gateway IPv4 address diff --git a/man/docker.1.md b/man/docker.1.md index 98135e50ff..25c799a0b5 100644 --- a/man/docker.1.md +++ b/man/docker.1.md @@ -35,6 +35,9 @@ To see the man page for a command run **man docker **. **--bip**="" Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b +**--config**="" + Specifies the location of the Docker client configuration files. The default is '~/.docker'. + **-D**, **--debug**=*true*|*false* Enable debug mode. Default is false.