cli icon indicating copy to clipboard operation
cli copied to clipboard

Use xdg basedir spec on linux

Open ogarcia opened this issue 5 years ago • 5 comments

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

TLDR; Instead of ~/.docker, configuration should be in the $XDG_CONFIG_HOME/docker/

ogarcia avatar Apr 07 '20 09:04 ogarcia

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.

jasonkarns avatar Mar 23 '21 13:03 jasonkarns

Any progress on this?

0x0D15 avatar Jul 21 '21 01:07 0x0D15

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.

sebdanielsson avatar Oct 26 '21 15:10 sebdanielsson

  • related https://github.com/docker/cli/issues/2738

thaJeztah avatar Jun 05 '23 14:06 thaJeztah

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.

nickjj avatar Dec 15 '25 18:12 nickjj