You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FR: Read /etc/docker/config.json in addition to ~/.docker/config.json #2738
As a sysadmin, I would like to set some options globally for all users.
So it would be good, if the logic reading ~/.docker/config.json would also read /etc/docker/config.json and merge the results.
When it comes to precedences, I think, the user's config should override the system config.
My major use case are proxies (see #93). Asking every user to configure them by hand is not optimal.
Reacted by Anselmo L. S. Melo, Tristan Spadi, James Sandford, ftorto, Denis Fateyev, Lomanic, Melchior NOGUES, matteocng, Ariel Barreiro, Jared Lumpe and 3 more
Thanks for your proposal. I agree that the configuration should be more "modular", so allow setting (system-wide) defaults, but also allowing overrides (per user and/or even per project (I proposed a .docker directory in some conversations that could be included in your project and could contain (all) docker-related files) or context; see #1621)
+1 for XDG Base Dir in general! (uncluttering $HOME)
Following XDG Basedir fully would introduce something like /etc/xdg/docker/, while we already have /etc/docker/ (for daemon.json and key.json). So maybe the search path for config.json should include both?
But how do we handle the case of changing and saving configuration files? Like using docker context use, docker context rm, docker login or docker logout.
docker login writes to the user's local ~/.docker/config.json. (Or in XDG world to ~/.config/docker/config.json)
The files in /etc/ should be read before the user's ones, so that the settings of the user overrides the system's one.
The idea is, that the system administrator wants to set sane defaults for things.
Activity
thaJeztah commentedon Sep 22, 2020
Thanks for your proposal. I agree that the configuration should be more "modular", so allow setting (system-wide) defaults, but also allowing overrides (per user and/or even per project (I proposed a
.dockerdirectory in some conversations that could be included in your project and could contain (all) docker-related files) or context; see #1621)We'll likely have to consider following https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html (for Linux at least; macOS and Windows t.b.d. on paths/priority)
ChristianTackeGSI commentedon Sep 22, 2020
+1 for XDG Base Dir in general! (uncluttering $HOME)
Following XDG Basedir fully would introduce something like
/etc/xdg/docker/, while we already have/etc/docker/(fordaemon.jsonandkey.json). So maybe the search path forconfig.jsonshould include both?RobertIndie commentedon Oct 21, 2020
But how do we handle the case of changing and saving configuration files? Like using
docker context use,docker context rm,docker loginordocker logout.ChristianTackeGSI commentedon Oct 21, 2020
docker loginwrites to the user's local~/.docker/config.json. (Or in XDG world to~/.config/docker/config.json)The files in
/etc/should be read before the user's ones, so that the settings of the user overrides the system's one.The idea is, that the system administrator wants to set sane defaults for things.
RobertIndie commentedon Nov 2, 2020
I'm interested to work on this.
fede843 commentedon Apr 30, 2024
Is there any update on this one?
darkhelmet commentedon Oct 9, 2025
I just fought with this for a few hours today because I thought "obviously I should be able to configure a global /etc/docker/config.json"