4

I need to edit my docker daemon's config, and from what I'm readong there are 2(?) that I 'can' use?

One path:

C:\ProgramData\Docker\config\daemon.json

Other path:

C:\Program Files\Docker\Docker\resources\windows-daemon-options.json

First question:

  • The windows-daemon-options.json already exists and has data in it (more on that below)
  • The daemon.json doesn't exist; I'd have to create it

So, do I just edit the windows-daemon-options.json, or do I create the daemon.json, and either just do in my edits, and then on daemon startup it'll sort of use the former as the "base" config and overwrite just the settings added with the latter? OR do I copy/paste ALL of the settings from the former to the latter, edit what I need, and then upon startup it'll use the regular daemon.json as the preferred config (sort of as if the former were a sample config)?

Second Question:

The data in windows-daemon-options.json has a lot of "redacted" in it, I'm wondering how that all figures into all of this?

i.e. here's the data in it (literally):

{
    "allow-nondistributable-artifacts": ["host_port_or_cidr|redacted"],
    "authorization-plugins": [],
    "bridge": "",
    "cluster-advertise": "",
    "cluster-store": "",
    "data-root": "path|redacted",
    "debug": true,
    "default-ulimits": {},
    "disable-legacy-registry": false,
    "dns": ["ip|redacted"],
    "dns-opts": [],
    "dns-search": ["domain|redacted"],
    "exec-opts": [],
    "experimental": true,
    "fixed-cidr": "redacted",
    "graph": "deprecated|redacted",
    "group": "",
    "hosts": ["endpoint|redacted"],
    "insecure-registries": ["host_port_or_cidr|redacted"],
    "labels": [],
    "live-restore": true,
    "log-driver": "",
    "log-level": "",
    "max-concurrent-downloads": 3,
    "max-concurrent-uploads": 5,
    "metrics-addr":"endpoint|redacted",
    "mtu": 0,
    "pidfile": "redacted",
    "raw-logs": false,
    "registry-mirrors": ["registry|redacted"],
    "shutdown-timeout": 15,
    "storage-driver": "",
    "storage-opts": [],
    "swarm-default-advertise-addr": "endpoint|redacted",
    "tlscacert": "redacted",
    "tlscert": "redacted",
    "tlskey": "redacted",
    "tlsverify": true
}

Hopefully I was able to clearly convey my questions.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94

3 Answers3

9

C:\ProgramData\Docker\config\daemon.json is for windows containers, this is the default location in windows daemon code.

C:\Users\<username>\.docker\daemon.json is for linux containers, this hyper-v/wls2/linux native default location.

Those 2 files are created when the corresponding daemon starts the first time.

3

When you start Docker Desktop in Windows container mode, if C:\ProgramData\Docker\config\daemon.json does not exist, it will get created with some default values. You can create it beforehand or edit it afterwards (and restart Docker Desktop).

Or you can use the UI (Settings / Docker Engine), which validates the changes. C:\Program Files\Docker\Docker\resources\windows-daemon-options.json is the schema internal file used for validation there, you probably don’t want to change it.

See also https://docs.docker.com/docker-for-windows/#docker-engine

mat007
  • 905
  • 8
  • 16
0

Just:

  1. Press WinKey+R
  2. Type: %userprofile%\.docker\
  3. Press Enter
J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
IvanMendoza
  • 121
  • 6