Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Little confusion dealing with docker desktop's daemon.json

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.

like image 744
J. Scott Elblein Avatar asked Sep 02 '25 14:09

J. Scott Elblein


1 Answers

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.

like image 87
Briney Emmanuel Avatar answered Sep 05 '25 16:09

Briney Emmanuel