Karol Lewandowski
Karol Lewandowski

Reputation: 41

How to change the Docker image installation directory on Mac?

Docker images are stored in $HOME/Library/Containers/com.docker.docker/Data but how to move those large files to an external drive for example? I have tried symbolic link, it didn't work. Also I couldn't find the -goption for docker as mentioned here. Any suggestions?

Upvotes: 4

Views: 5496

Answers (2)

HaiTH
HaiTH

Reputation: 1061

Recent versions of Docker Desktop (around 4.18 until now) is having issues with Disk image location configuration. It will hang forever if you change this path via Docker Desktop Settings. But there's a workaround to modify it via ~/.docker/daemon.json:

{
  "data-root": "/path/to/new/directory"
}

Exit Docker Desktop and restart again. Please note that Docker may start with empty data.

Upvotes: 0

Bruno Almeida
Bruno Almeida

Reputation: 139

All you have to do is go to preferences

enter image description here

Then Disk and click at "move disk image"

enter image description here

Select the folder you want to move to, awaits it completes and you are done.

Upvotes: 5

Related Questions