Use xdg basedir spec on linux
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
TLDR; Instead of ~/.docker, configuration should be in the $XDG_CONFIG_HOME/docker/
Two points of clarification: the config should be in ${XDG_CONFIG_HOME:-~/.config}/docker (the fallback for XDG_CONFIG_HOME if the variable is not set is ~/.config.
Also, it's important to note that only true configuration should go in this directory. runtime temp files, cache files, or data files should not be stored there. Rule of thumb: if one wouldn't version the file/contents in their "dotfiles" repo for backups or sharing across machines, then it shouldn't be in config.
Any progress on this?
Yeah it's really, really annoying to have a million directories for every software living in the home directory. Please move the config files to ${XDG_CONFIG_HOME}/docker.
- related https://github.com/docker/cli/issues/2738
I'd like to see this too, but beyond moving everything from ~/.docker into $XDG_CONFIG_HOME/docker.
XDG_CONFIG_HOME is meant for config files but there's a lot of other non-config files in ~/.docker. The specification linked in the issue goes over where those files could be located. There's data, cache, state, and runtime directories as well.
Personally I'd approach this as an all or nothing thing. Having the current set up with ~/.docker is better than only putting the config files in $XDG_CONFIG_HOME/docker or putting everything there.