I’m just started using Docker by installing Docker for Mac. There are no container or images.
How do I change images/container default storage directory to another location?
I’m also looking for the solution of this question.
When you have installed the docker via docker toolbox. The docker-machine VM is called “default” and it exists in /Users//.docker/machine/machines/default/ directory.
One reason I’d like to move them is just to stop my main drive filling with stuff. Being able to relocate the images, or the whole VM to another drive would be useful for those with small main drives and huge external drives.
Well what about adopting the ENV variables the same way docker toolbox would. ? I’m surprised that something like this is such a debate. Disk space is really an important factor and it think its obvious that one would want to be able to preserve their device as much as possible. I think being able to configure how a software uses up your disk space should be something taken into consideration when devising these tooling apparatuses.
Yes please, enable a way to changing this, it’s killing my main disk as well. What mbklein proposed is a nice workaround “patch” but not a real fix to a critical feature.
Just to confirm, the proposed symlinking solution worked for me.
> sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.1
BuildVersion: 16B2555
> docker --version
Docker version 1.12.3, build 6b644ec
> rsync --version
rsync version 3.1.2 protocol version 31
...
instead of cp -R com.docker.docker /Volumes/..., I had to do rsync -a com.docker.docker /Volumes/...
some files are “socket” files and they refused to be copied via cp.
Yep, just to confirm a second time - that’s a working solution…
Actually it’s fine to just move the Docker Image to the location of your choice and symlinking that. Then you don’t run into the socket errors mentioned by drwin:
When using Docker for Mac, there is a preference for the the storage location in the advanced tab. You change the location and confirm with Apply & Restart. Docker for Mac will move the storage archive and take care of the rest. This can obviously take some time depending on storage size and disk speed… be patient.
I used the move Disk image location option in Docker Preferences (Version 18.03.1-ce-mac65 (24312)) and after a restart Docker doesn’t find the images. Running docker images in Terminal doesn’t return anything other than the header fields. I moved the images to an external Transcend JetDrive to reduce the container build up on the Mac drive. Is there something else I need to do to point Docker to the images? I was thinking of uninstalling Docker then reinstalling and before creating anything change the image location but this is a bit more drastic than what I was hoping to do. Thanks!
I’m on desktop version 2.3.0.4. I changed the location in the preferences and clicked apply&restart. It successfully restarted. But when i check there is not file under the new folder i created as the new location. Also if i close the desktop interface and then opened it again, the path went back to the old one. I have tried multiple times but no luck. Is it a bug?