Fixes #12088
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
| ... | ... |
@@ -109,6 +109,7 @@ pages: |
| 109 | 109 |
- ['articles/dockerfile_best-practices.md', 'Articles', 'Best practices for writing Dockerfiles'] |
| 110 | 110 |
- ['articles/certificates.md', 'Articles', 'Using certificates for repository client verification'] |
| 111 | 111 |
- ['articles/using_supervisord.md', 'Articles', 'Using Supervisor'] |
| 112 |
+- ['articles/configuring.md', 'Articles', 'Configuring Docker'] |
|
| 112 | 113 |
- ['articles/cfengine_process_management.md', 'Articles', 'Process management with CFEngine'] |
| 113 | 114 |
- ['articles/puppet.md', 'Articles', 'Using Puppet'] |
| 114 | 115 |
- ['articles/chef.md', 'Articles', 'Using Chef'] |
| 115 | 116 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,60 @@ |
| 0 |
+page_title: Configuring Docker |
|
| 1 |
+page_description: Configuring the Docker daemon on various distributions |
|
| 2 |
+page_keywords: docker, daemon, configuration |
|
| 3 |
+ |
|
| 4 |
+# Configuring Docker on various distributions |
|
| 5 |
+ |
|
| 6 |
+After successfully installing the Docker daemon on a distribution, it runs with it's default |
|
| 7 |
+config. Usually it is required to change the default config to meet one's personal requirements. |
|
| 8 |
+ |
|
| 9 |
+Docker can be configured by passing the config flags to the daemon directly if the daemon |
|
| 10 |
+is started directly. Usually that is not the case. A process manager (like SysVinit, Upstart, |
|
| 11 |
+systemd, etc) is responsible for starting and running the daemon. |
|
| 12 |
+ |
|
| 13 |
+Some common config options are |
|
| 14 |
+ |
|
| 15 |
+* `-D` : Enable debug mode |
|
| 16 |
+ |
|
| 17 |
+* `-H` : Daemon socket(s) to connect to |
|
| 18 |
+ |
|
| 19 |
+* `--tls` : Enable or disable TLS authentication |
|
| 20 |
+ |
|
| 21 |
+The complete list of flags can found at [Docker Command Line Reference](/reference/commandline/cli/) |
|
| 22 |
+ |
|
| 23 |
+## Ubuntu |
|
| 24 |
+ |
|
| 25 |
+After successfully [installing Docker for Ubuntu](/installation/ubuntulinux/), you can check the |
|
| 26 |
+running status using (if running Upstart) |
|
| 27 |
+ |
|
| 28 |
+ $ sudo status docker |
|
| 29 |
+ docker start/running, process 989 |
|
| 30 |
+ |
|
| 31 |
+You can start/stop/restart `docker` using |
|
| 32 |
+ |
|
| 33 |
+ $ sudo start docker |
|
| 34 |
+ |
|
| 35 |
+ $ sudo stop docker |
|
| 36 |
+ |
|
| 37 |
+ $ sudo restart docker |
|
| 38 |
+ |
|
| 39 |
+ |
|
| 40 |
+### Configuring Docker |
|
| 41 |
+ |
|
| 42 |
+Docker options can be configured by editing the file `/etc/default/docker`. If this file does not |
|
| 43 |
+exist, it needs to be createdThis file contains a variable named `DOCKER_OPTS`. All the |
|
| 44 |
+config options need to be placed in this variable. For example |
|
| 45 |
+ |
|
| 46 |
+ DOCKER_OPTS=" --dns 8.8.8.8 -D --tls=false -H tcp://0.0.0.0:2375 " |
|
| 47 |
+ |
|
| 48 |
+The above daemon options : |
|
| 49 |
+ |
|
| 50 |
+1. Set dns server for all containers |
|
| 51 |
+ |
|
| 52 |
+2. Enable Debug mode |
|
| 53 |
+ |
|
| 54 |
+3. Set tls to false |
|
| 55 |
+ |
|
| 56 |
+4. Make the daemon listen for connections on `tcp://0.0.0.0:2375` |
|
| 57 |
+ |
|
| 58 |
+After saving the file, restart docker using `sudo restart docker`. Verify that the daemon is |
|
| 59 |
+running with the options specified by running `ps aux | grep docker | grep -v grep` |