docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/docker/roadmap/projects/1
Creative Commons Zero v1.0 Universal
1.45k stars 246 forks source link

Add a preference in macOS Docker Desktop to move where .docker is located #408

Open pedz opened 1 year ago

pedz commented 1 year ago

Tell us about your request A clear and concise description of what you want to happen or the change you would like to see The macOS GUI app Docker Desktop creates a directory $HOME/.docker and puts various configuration files in there. I am attempting to follow the XDG_CONFIG_HOME standard so my home directory isn't littered with a lot of dot files. Unfortunately, macOS does not have an accepted way to set environment variables at boot time so the only nice way to solve this would be for Docker Desktop to offer a preference to move where it puts the .docker directory. The command line interfaces have a way to specify the location of the .docker directory via environment variables which I did but then as soon as I start the Desktop, the .docker directory is recreated. This is likely a problem only for macOS ( and perhaps Windows).

Which service(s) is this request for? Let us know which product(s) you want this for? macOS Docker Desktop (the graphical application)

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I want to keep my home directory free from many "dot files" such as .docker and hide them in a common place like $HOME/.config/docker

Are you currently working around the issue? A clear and concise description of any alternative solutions or features you've considered or are using today. No. I just live with $HOME/.docker

Additional context Add any other context or screenshots about the feature request here. I opened a Docker Discussion and was encouraged to open a feature request here.

thaJeztah commented 1 year ago

Thanks for opening the ticket here; In general, I'm (personally) in favor of adding support for these, as they become more commonly used.

I know there's been discussions around that in the past, which got stuck trying to reach concensus on wether or not to implement this equally for Linux and macOS (as XDG is a Linux-specific concept), but also on priority of paths and (possibly) migration.

Somewhat orthogonal to that, there's been some (internal) discussions about improving configuration management for the CLI (improving docker context, (per project) overrides, and other changes).

For the proposed change in this ticket, I think this would require a combination of changes to be implemented; first of all, the docker CLI's would need to be aware of the XDG environment variables; For Docker Desktop, there may be changes needed as well, as Desktop re-uses the ~/.docker directory to store additional (configuration) files, such as a copy of the Docker Engine's daemon.json, and (on Windows) performs synchronisation between the .docker directory within WSL2 and on the Windows filesystem.

Tony-Sol commented 10 months ago

Is there a way just support configuration setting similar with DOCKER_CONFIG env variable? As long as a bunch of Docker Desktop configs are already stored in ~/Library/Application Support/Docker Desktop.

For me, it's more frustrating to have ~/.docker in my $HOME than a necessity to setup a single parameter after installation just once.

sdavids commented 6 months ago

The new directory structure should take this into account as well: #586

vitoschuster commented 6 months ago

Hello, I came across this issue for the same reason as the op described, are there any updates on the progress?

Also, I agree with @Tony-Sol, would be much appreciated for a simple env variable for us, mac users to configure

Fau818 commented 5 months ago

This is a great feature, hopefully it will be implemented soon.

ianjukes commented 3 months ago

+1 for this! Just came searching for a way to move .docker to $XDG_CONFIG_HOME/docker on macOS, and also .kube to $XDG_CONFIG_HOME/kube. Thanks for considering.

Tony-Sol commented 1 month ago

Is this proposal planned to be added into project?