{"id":14106,"date":"2022-10-03T14:17:01","date_gmt":"2022-10-03T14:17:01","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14106"},"modified":"2025-07-12T05:40:17","modified_gmt":"2025-07-12T05:40:17","slug":"how-to-configure-docker-daemon-with-a-configuration-file","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-configure-docker-daemon-with-a-configuration-file\/","title":{"rendered":"Docker Tutorials: Configure Docker daemon with a configuration file?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is docker Daemon?<\/h2>\n\n\n\n<p>The Docker daemon is a service that runs on your host operating system.<br>It currently only runs on Linux because it depends on a number of Linux kernel features, but there are a few ways to run Docker on MacOS and Windows too.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is daemon.json?<\/h2>\n\n\n\n<p>daemon.json is the file name which is being used to Configure Docker daemon. There are two ways to configure the Docker daemon:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use a JSON configuration file. This is the preferred option, since it keeps all configurations in a single place.<\/li><li>Use flags when starting dockerd.<\/li><\/ul>\n\n\n\n<p>The preferred method for configuring the Docker Engine is using a configuration file. You can create this file if it doesn&#8217;t already exist. The &#8211;config-file flag can be used to specify a non-default location.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Location of docker configuration file<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Linux &#8211; RHEL &#8211; The default location of the configuration file on Linux is \/etc\/docker\/daemon.json<\/li><li>Linux &#8211; Ubuntu &#8211; The default location of the configuration file on Linux is \/etc\/docker\/daemon.json<\/li><li>Windows &#8211; %programdata%\\docker\\config\\daemon.json. The configuration file can be found at &#8216;C:\\ProgramData\\Docker\\config\\daemon.json&#8217;.<\/li><\/ul>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/0ba58867ded685b5db8f10538869db26.js\"><\/script>\n\n\n\n<h3 class=\"wp-block-heading\">Some options can be reconfigured when the daemon is running without requiring to restart the process<\/h3>\n\n\n\n<p>The list of currently supported options that can be reconfigured is this:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>debug: it changes the daemon to debug mode when set to true.<\/li><li>cluster-store: it reloads the discovery store with the new address.<\/li><li>cluster-store-opts: it uses the new options to reload the discovery store.<\/li><li>cluster-advertise: it modifies the address advertised after reloading.<\/li><li>labels: it replaces the daemon labels with a new set of labels.<\/li><li>live-restore: Enables keeping containers alive during daemon downtime.<\/li><li>max-concurrent-downloads: it updates the max concurrent downloads for each pull.<\/li><li>max-concurrent-uploads: it updates the max concurrent uploads for each push.<\/li><li>default-runtime: it updates the runtime to be used if not is specified at container creation. It defaults to \u201cdefault\u201d which is the runtime shipped with the official docker packages.<\/li><li>runtimes: it updates the list of available OCI runtimes that can be used to run containers.<\/li><li>authorization-plugin: it specifies the authorization plugins to use.<\/li><li>allow-nondistributable-artifacts: Replaces the set of registries to which the daemon will push nondistributable artifacts with a new set of registries.<\/li><li>insecure-registries: it replaces the daemon insecure registries with a new set of insecure registries. If some existing insecure registries in daemon\u2019s configuration are not in newly reloaded insecure resgitries, these existing ones will be removed from daemon\u2019s config.<\/li><li>registry-mirrors: it replaces the daemon registry mirrors with a new set of registry mirrors. If some existing registry mirrors in daemon\u2019s configuration are not in newly reloaded registry mirrors, these existing ones will be removed from daemon\u2019s config.<\/li><li>shutdown-timeout: it replaces the daemon\u2019s existing configuration timeout with a new timeout for shutting down all containers.<\/li><li>features: it explicitly enables or disables specific features.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-devopsschool-com\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"jDPtiRSO8B\"><a href=\"https:\/\/www.devopsschool.com\/blog\/example-of-daemon-json-or-docker-conf-complete-options\/\">Example of daemon.json or docker.conf &#8211; Complete Options<\/a><\/blockquote><iframe loading=\"lazy\" title=\"&#8220;Example of daemon.json or docker.conf &#8211; Complete Options&#8221; &#8212; DevOpsSchool.com\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"https:\/\/www.devopsschool.com\/blog\/example-of-daemon-json-or-docker-conf-complete-options\/embed\/#?secret=jDPtiRSO8B\" data-secret=\"jDPtiRSO8B\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Docker Tutorials Fundamental To Advanced-2021 Crash Course:- <a href=\"https:\/\/bit.ly\/3hOIbTB\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/bit.ly\/3hOIbTB<\/a><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_92153\"><iframe loading=\"lazy\"  id=\"_ytid_56712\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_92153\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>What is docker Daemon? The Docker daemon is a service that runs on your host operating system.It currently only runs on Linux because it depends on a number of Linux&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862,1],"tags":[],"class_list":["post-14106","post","type-post","status-publish","format-standard","hentry","category-docker","category-sql"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=14106"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14106\/revisions"}],"predecessor-version":[{"id":31433,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14106\/revisions\/31433"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}