From c013eac2c63729e44f0d2b9644d2f9ad895d7dd6 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:45:34 +0100 Subject: [PATCH 1/6] engine: clarify daemon.json config file location Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index 7f4141f046..c52953c639 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -48,17 +48,31 @@ You can use both of these options together as long as you don't specify the same option both as a flag and in the JSON file. If that happens, the Docker daemon won't start and prints an error message. -To configure the Docker daemon using a JSON file, create a file at -`/etc/docker/daemon.json` on Linux systems, or -`C:\ProgramData\docker\config\daemon.json` on Windows. +### Configuration file -Using this configuration file, run the Docker daemon in debug mode, using TLS, and -listen for traffic routed to `192.168.59.3` on port `2376`. You can learn what -configuration options are available in the +The following table shows the location where the Docker daemon expects to find +the configuration file by default, depending on your system and how you're +running the daemon. + +| OS and configuration | File location | +| -------------------- | ------------------------------------------ | +| Linux, regular setup | `/etc/docker/daemon.json` | +| Linux, rootless mode | `~/.config/docker/daemon.json` | +| Windows | `C:\ProgramData\docker\config\daemon.json` | + +For rootless mode, the daemon respects the `XDG_CONFIG_HOME` variable. If set, +the expected file location is `$XDG_CONFIG_HOME/docker/daemon.json`. + +You can also explicitly specify the location of the configuration file on +startup, using the `dockerd --config-file` flag. + +You can learn what configuration options are available in the [dockerd reference docs](../../engine/reference/commandline/dockerd.md#daemon-configuration-file) -You can also start the Docker daemon manually and configure it using flags. This -can be useful for troubleshooting problems. +### Configuration using flags + +You can also start the Docker daemon manually and configure it using flags. +This can be useful for troubleshooting problems. Here's an example of how to manually start the Docker daemon, using the same configurations as shown in the previous JSON configuration: From 49faf5386b8e07ae9d71de351296c08ceef6ede6 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:46:19 +0100 Subject: [PATCH 2/6] engine: move "next steps" to separate section Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index c52953c639..43b211b865 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -93,14 +93,6 @@ running: $ dockerd --help ``` -Many specific configuration options are discussed throughout the Docker -documentation. Some places to go next include: - -- [Automatically start containers](../containers/start-containers-automatically.md) -- [Limit a container's resources](../containers/resource_constraints.md) -- [Configure storage drivers](../../storage/storagedriver/select-storage-driver.md) -- [Container security](../../engine/security/index.md) - You can configure most daemon options using the `daemon.json` file. One thing you can't configure using daemon.json mechanism is an HTTP proxy. For instructions on using a proxy, see @@ -130,3 +122,13 @@ Since the state of a Docker daemon is kept on this directory, make sure you use a dedicated directory for each daemon. If two daemons share the same directory, for example, an NFS share, you are going to experience errors that are difficult to troubleshoot. + +## Next steps + +Many specific configuration options are discussed throughout the Docker +documentation. Some places to go next include: + +- [Automatically start containers](../containers/start-containers-automatically.md) +- [Limit a container's resources](../containers/resource_constraints.md) +- [Configure storage drivers](../../storage/storagedriver/select-storage-driver.md) +- [Container security](../../engine/security/index.md) From 63191bbee1350442aeafa7cfef354efb923b9663 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:47:54 +0100 Subject: [PATCH 3/6] engine: remove incorrect statement about proxy config with daemon.json Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index 43b211b865..f2f3cb119a 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -93,11 +93,6 @@ running: $ dockerd --help ``` -You can configure most daemon options using the `daemon.json` file. One thing -you can't configure using daemon.json mechanism is an HTTP proxy. For -instructions on using a proxy, see -[Configure Docker to use a proxy server](../../network/proxy.md). - ## Daemon data directory The Docker daemon persists all data in a single directory. This tracks From 99313faeafea01677638f3d064b0a4cca7f50c9e Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:35:23 +0100 Subject: [PATCH 4/6] editorial: rephrase too many "you can" Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index f2f3cb119a..dac09be909 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -66,7 +66,7 @@ the expected file location is `$XDG_CONFIG_HOME/docker/daemon.json`. You can also explicitly specify the location of the configuration file on startup, using the `dockerd --config-file` flag. -You can learn what configuration options are available in the +Learn about the available configuration options in the [dockerd reference docs](../../engine/reference/commandline/dockerd.md#daemon-configuration-file) ### Configuration using flags @@ -85,7 +85,7 @@ $ dockerd --debug \ --host tcp://192.168.59.3:2376 ``` -You can learn what configuration options are available in the +Learn about the available configuration options in the [dockerd reference docs](../../engine/reference/commandline/dockerd.md), or by running: From 36a1e0482fc7bcddbc624a19abfc365762492445 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:36:34 +0100 Subject: [PATCH 5/6] engine: link to proxy config from daemon configuration overview Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index dac09be909..c466d84d10 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -127,3 +127,4 @@ documentation. Some places to go next include: - [Limit a container's resources](../containers/resource_constraints.md) - [Configure storage drivers](../../storage/storagedriver/select-storage-driver.md) - [Container security](../../engine/security/index.md) +- [Configure the Docker daemon to use a proxy](./systemd.md#httphttps-proxy) From 553f5b75ed5c011731b05dc1a9ce841cdd8d4657 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:37:08 +0100 Subject: [PATCH 6/6] chore: update link (index.md -> _index.md) Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/daemon/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/config/daemon/_index.md b/content/config/daemon/_index.md index c466d84d10..59cd93f8f5 100644 --- a/content/config/daemon/_index.md +++ b/content/config/daemon/_index.md @@ -126,5 +126,5 @@ documentation. Some places to go next include: - [Automatically start containers](../containers/start-containers-automatically.md) - [Limit a container's resources](../containers/resource_constraints.md) - [Configure storage drivers](../../storage/storagedriver/select-storage-driver.md) -- [Container security](../../engine/security/index.md) +- [Container security](../../engine/security/_index.md) - [Configure the Docker daemon to use a proxy](./systemd.md#httphttps-proxy)