docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

Docker hangs on Disk Image Location change to empty folder on external volume #6803

Open dontturnaway opened 1 year ago

dontturnaway commented 1 year ago

Expected behavior

After changing Settings -> Resources -> Advanced -> Disk Image location to external volume -> empty folder, Docker should successfully change it to new location and restart.

Actual behavior

After changing Settings -> Resources -> Advanced -> Disk Image location to an empty folder on external volume, Docker hangs forever on "Apply & restart", the circle of progress bar constantly spins. Docker service becomes inactive and hangs in restarting state. Screenshot 2023-04-13 at 16 26 53

If I try to do it for the same partition, where disk image originally was, it works as intended.

Information

I did a clean install of Docker Desktop from the official site. Waited for it to finish changing directory for more than 30 mins. The directory to where I move is clean of any files. A disk space available is more than 100Gb on both drives, where Docker is installed and the directory, where I move. The disk is free of errors and the both volumes for Docker and where I move is internal disk of MacBook, which never failed and allows blazing fast disk access. I also tried:

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

[2023-04-13T12:40:46.973584000Z][com.docker.diagnose][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": dial unix diagnosticd.sock: connect: no such file or directory
[2023-04-13T12:40:46.983219000Z][com.docker.diagnose][I] ipc.NewClient: 69cbf4f4-diagnose -> diagnosticd.sock diagnosticsd
[2023-04-13T12:40:46.983437000Z][com.docker.diagnose][I] (f5619988) 69cbf4f4-diagnose C->S diagnosticsd GET /ping
[2023-04-13T12:40:46.983746000Z][com.docker.diagnose][W] (f5619988) 69cbf4f4-diagnose C<-S NoResponse GET /ping (303.834µs): Get "http://ipc/ping": dial unix diagnosticd.sock: connect: no such file or directory

[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:46.984240000Z][com.docker.diagnose][I] ipc.NewClient: 3ad77a33-com.docker.diagnose -> lifecycle-server.sock VMDockerdAPI
[2023-04-13T12:40:46.984564000Z][com.docker.diagnose][I] (4db55475) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /docker
[2023-04-13T12:40:46.984871000Z][com.docker.diagnose][W] (4db55475) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /docker (304.875µs): Get "http://ipc/docker": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:46.985083000Z][com.docker.diagnose][I] (4db55475-1) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:46.985309000Z][com.docker.diagnose][W] (4db55475-1) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (224.709µs): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:47.985670000Z][com.docker.diagnose][I] (4db55475-2) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:47.988156000Z][com.docker.diagnose][W] (4db55475-2) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.485708ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:48.989218000Z][com.docker.diagnose][I] (4db55475-3) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:48.991239000Z][com.docker.diagnose][W] (4db55475-3) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.127042ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:49.992449000Z][com.docker.diagnose][I] (4db55475-4) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:49.994634000Z][com.docker.diagnose][W] (4db55475-4) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.176041ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:50.995807000Z][com.docker.diagnose][I] (4db55475-5) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:50.998085000Z][com.docker.diagnose][W] (4db55475-5) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.26975ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:51.999422000Z][com.docker.diagnose][I] (4db55475-6) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:52.001589000Z][com.docker.diagnose][W] (4db55475-6) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.164125ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:53.002692000Z][com.docker.diagnose][I] (4db55475-7) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:53.004767000Z][com.docker.diagnose][W] (4db55475-7) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.068667ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory
[2023-04-13T12:40:54.006103000Z][com.docker.diagnose][I] (4db55475-8) 3ad77a33-com.docker.diagnose C->S VMDockerdAPI GET /ping
[2023-04-13T12:40:54.008382000Z][com.docker.diagnose][W] (4db55475-8) 3ad77a33-com.docker.diagnose C<-S NoResponse GET /ping (2.2805ms): Get "http://ipc/ping": dial unix lifecycle-server.sock: connect: no such file or directory

[FAIL] DD0015: are the binary symlinks installed? 2 errors occurred:
    * checking binaries in /usr/local/bin: looking for /usr/local/bin/docker: lstat /usr/local/bin/docker: permission denied
    * checking binaries in $HOME/.docker/bin: unable to find /Users/Rage/.docker/bin: stat /Users/Rage/.docker/bin: no such file or directory

[FAIL] DD0031: does the Docker API work? Cannot connect to the Docker daemon at unix://docker.raw.sock. Is the docker daemon running?
[FAIL] DD0013: is the $PATH ok? unable to find docker executable on PATH
[FAIL] DD0003: is the Docker CLI working? exec: "docker": executable file not found in $PATH
[PASS] DD0038: is the connection to Docker working?
[FAIL] DD0014: are the backend processes running? 3 errors occurred:
    * com.docker.vpnkit is not running
    * com.docker.driver.amd64-linux is not running
    * com.docker.virtualization is not running

[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[FAIL] DD0010: is the Docker API proxy responding? failed to ping Docker proxy API with error: Get "http://ipc/desktop-diagnostics/ping": read unix ->/Users/Rage/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)
[2023-04-13T12:40:55.747620000Z][com.docker.diagnose][I] ipc.NewClient: be681834-diagnose -> <HOME>/.docker/run/docker.sock Proxy
[2023-04-13T12:40:55.747962000Z][com.docker.diagnose][I] (2962e667) be681834-diagnose C->S Proxy GET /desktop-diagnostics/ping
[2023-04-13T12:40:56.749688000Z][com.docker.diagnose][W] (2962e667) be681834-diagnose C<-S NoResponse GET /desktop-diagnostics/ping (1.001707834s): Get "http://ipc/desktop-diagnostics/ping": read unix -><HOME>/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)
[2023-04-13T12:40:56.751581000Z][com.docker.diagnose][I] (2962e667-1) be681834-diagnose C->S Proxy GET /ping
[2023-04-13T12:40:57.754142000Z][com.docker.diagnose][W] (2962e667-1) be681834-diagnose C<-S NoResponse GET /ping (1.002534333s): Get "http://ipc/ping": read unix -><HOME>/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)
[2023-04-13T12:40:58.756890000Z][com.docker.diagnose][I] (2962e667-2) be681834-diagnose C->S Proxy GET /ping
[2023-04-13T12:40:59.759177000Z][com.docker.diagnose][W] (2962e667-2) be681834-diagnose C<-S NoResponse GET /ping (1.002291042s): Get "http://ipc/ping": read unix -><HOME>/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)
[2023-04-13T12:41:00.761361000Z][com.docker.diagnose][I] (2962e667-3) be681834-diagnose C->S Proxy GET /ping
[2023-04-13T12:41:01.763714000Z][com.docker.diagnose][W] (2962e667-3) be681834-diagnose C<-S NoResponse GET /ping (1.002354334s): Get "http://ipc/ping": read unix -><HOME>/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)
[2023-04-13T12:41:02.766400000Z][com.docker.diagnose][I] (2962e667-4) be681834-diagnose C->S Proxy GET /ping
[2023-04-13T12:41:03.769550000Z][com.docker.diagnose][W] (2962e667-4) be681834-diagnose C<-S NoResponse GET /ping (1.003080042s): Get "http://ipc/ping": read unix -><HOME>/.docker/run/docker.sock: i/o timeout (Client.Timeout exceeded while awaiting headers)

[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[WARN] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": dial unix diagnosticd.sock: connect: no such file or directory
[WARN] DD0004: is the Docker engine running? Get "http://ipc/docker": dial unix lifecycle-server.sock: connect: no such file or directory
[WARN] DD0015: are the binary symlinks installed? 2 errors occurred:
    * checking binaries in /usr/local/bin: looking for /usr/local/bin/docker: lstat /usr/local/bin/docker: permission denied
    * checking binaries in $HOME/.docker/bin: unable to find /Users/Rage/.docker/bin: stat /Users/Rage/.docker/bin: no such file or directory

[WARN] DD0031: does the Docker API work? Cannot connect to the Docker daemon at unix://docker.raw.sock. Is the docker daemon running?
[WARN] DD0032: do Docker networks overlap with host IPs? Cannot connect to the Docker daemon at unix://docker.raw.sock. Is the docker daemon running?

Steps to reproduce the behavior

  1. Start Docker
  2. Go to 'Settings -> Resources -> Advanced -> Disk Image location'
  3. Change location to empty folder of external drive, which is not protected from the read/write
  4. See the app hangs as on the screen I provided above
dontturnaway commented 1 year ago

I found the similar issue here https://github.com/docker/for-mac/issues/6797, but there wasn't Diagnostics ID, so I'm afraid it would be closed. Don't want to unfocus this issue due a formal errors of templating by another author.

Abirdcfly commented 1 year ago

I have the same problem.

After reinstall version 4.16.0 (95345) and change disk image localtion works fine.

Then update to latest version 4.18.0 (104112)

dontturnaway commented 1 year ago

After reinstall version 4.16.0 (95345) and change disk image localtion works fine.

Then update to latest version 4.18.0 (104112)

So, to overcome this bug I need to downgrade first my 4.18 (104112) - > 4.16 and then upgrade again 4.16 - > 4.18? Right?

Abirdcfly commented 1 year ago

So, to overcome this bug I need to downgrade first my 4.18 (104112) - > 4.16 and then upgrade again 4.16 - > 4.18? Right?

Yes, by doing that, I successfully changed the disk image localtion to my external hard drive.

dontturnaway commented 1 year ago

Yes, by doing that, I successfully changed the disk image localtion to my external hard drive.

Are you able to uninstall Docker Desktop too using appropriate menu in program (Docker -> Troubleshoot -> Uninstall)? I was even unable to uninstall it to switch to the previous version you mention. At least, with using GUI. Screenshot 2023-04-19 at 11 50 33 Only /Applications/Docker.app/Contents/MacOS/uninstall works.

Abirdcfly commented 1 year ago

Yes, by doing that, I successfully changed the disk image localtion to my external hard drive.

Are you able to uninstall Docker Desktop too using appropriate menu in program (Docker -> Troubleshoot -> Uninstall)? I was even unable to uninstall it to switch to the previous version you mention. At least, with using GUI. Screenshot 2023-04-19 at 11 50 33 Only /Applications/Docker.app/Contents/MacOS/uninstall works.

same.

TomLBZ commented 1 year ago

Same problem on latest version (4.19). Hangs indefinitely on changing the docker image directory.

khoa-io commented 1 year ago

I have the same problem.

After reinstall version 4.16.0 (95345) and change disk image localtion works fine.

Then update to latest version 4.18.0 (104112)

Same problem on latest version (4.19). Hangs indefinitely on changing the docker image directory.

After uninstall 4.19 and install 4.16.0, it can changes disk image location.

srp3rd commented 1 year ago

Same issue.

MeowKim commented 1 year ago

Any progress on this? same issue on Windows 10 Pro.

dzou commented 1 year ago

Same here +1.

Thanks for the workaround with the downgraded versions, that worked for me. As a reference, check the Docker release notes to find where to download an older version: https://docs.docker.com/desktop/release-notes/#4163

GuilhermeMGBR commented 1 year ago

Same here on 4.20.0 (109717) at macOS Ventura, downgrading to 4.16.2 also worked

jimmygchen commented 1 year ago

Another workaround that worked for me without downgrading and using a symlink to the external volume: https://www.howtogeek.com/devops/how-to-store-docker-images-and-containers-on-an-external-drive/

tomaszstachera commented 1 year ago

Still hangs on 4.21.1 (114176), but workaround with symlink works, but needs to point from data folder in first location to another folder in second location.

https://www.howtogeek.com/devops/how-to-store-docker-images-and-containers-on-an-external-drive/

sparkcodeuk commented 1 year ago

I did find a sort of halfway house to sorting this as I was experiencing the same issue, wanting to move my Docker.raw to an external SSD. This is on OSX Ventura. Just bear in mind with this approach you will lose all data in the Docker.raw as it will initialise a new one.

Here what I did:-

Just bear in mind this is just moving Docker.raw and not any of the log files etc. I've not bothered moving the rest although I'm guessing symlinking the directory itself further up the path would likely work, but I only really care about moving the main docker disk image file.

Why didn't I copy the Docker.raw to the SSD to retain my existing docker images/volumes etc.?

Well you could and maybe that would work, but it appears as though the file has a "virtual allocation" of what you set it to (128GB in my case) and doing a copy of that will copy the entire 128GB file so you'll immediately waste a load of space that's not actually been written to. So for me 30GB used out of 128GB would have wasted near 100GB of space on the SSD.

I'm sure there's maybe a way of copying while keeping the virtual allocation intact through dd or something, but didn't bother to look too deeply into this side of things.

I can't vouch for the stability of this hack (e.g., not checked/ran into what happens if the disk isn't attached and docker is running or it started up), but appears to be working. I guess you'd probably risk maybe Docker.raw file corruption which it can't recover from and you have to re-initialise a fresh Docker.raw.

I hope this helps someone.

Jingogogo commented 1 year ago

I met the same question. I tried some ways but it failed. Then when I changed my "virtual disk limit" and "Disk image location", and clicked the"Apply & restart" button both, it worked. I hope this can help. My docker desktop version is 24.0.2

gyrex commented 1 year ago

I'm encountering this issue on v4.21.1 (114176)

LookKit commented 1 year ago

Me too

gaord commented 1 year ago

same issue with v4.19.0. It costs 60GB, too much to sustain in 256GB system disk. It would be nice to get solved soon. Hopefully 4.21.2?

robert914 commented 1 year ago

Same issue for me with 4.22.0 (117440) on Ventura 13.5 (22G74) using the "Virtualization Framework" option (if that matters). It also seems to take it sometimes without hanging but then a restart of the Docker Desktop app causes it to revert back to the original location and never use the new one.

Update The below is a work-around that appears to work for me at least:

  1. Quit the Docker Desktop application completely.
  2. Make sure no remaining Docker processes are running: ps -efww | grep Docker
  3. Create a new directory on your external SSD: mkdir -vp /Volumes/<Name>/DockerDesktop/vms
  4. Goto the default data storage directory: cd ~Library/Containers/com.docker.docker/Data
  5. Remove the existing vms directory: rm -rf vms
  6. Replace with a symlink to the above new directory: ln -s /Volumes/<Name>/DockerDesktop/vms .
  7. Start the Docker Desktop application.
moroboro commented 1 year ago

Had the same problem on Ventura 13.4.1 (Intel i5) and Docker 4.21.1

Got it working after doing a clean/purge and reset to factory defaults.

SCR-20231023-mcvm
shayneoneill commented 1 year ago

Anyone got a solution to this yet? (On mac docker desktop). I have about 15gigs of space left on my main drive and a nvme high speed ext hard drive (Takes about 15 seconds to move 30gigs of ram onto it, its fast) to move it to, but it shits the bed everytime I try.

wahyudotdev commented 1 year ago

Anyone got a solution to this yet? (On mac docker desktop). I have about 15gigs of space left on my main drive and a nvme high speed ext hard drive (Takes about 15 seconds to move 30gigs of ram onto it, its fast) to move it to, but it shits the bed everytime I try.

Uninstal your current docker installation then install v4.16.xx instead , then move your docker image to external ssd trough setting. Verify docker installation by running some docker sample, and if it success then you can update docker desktop to latest version. This way works on my mac m1 air with 512 GB external NVME SSD

tegnike commented 1 year ago

I couldn't change Disk image location even if I installed v4.16.2 Mac with Apple chip.

  1. Uninstalle v4.21.x
  2. Installed v4.16.2 (I tried also v4.16.0, v.4.15.0, but same)
  3. Start Docker Desktop
  4. Apply change of Disk image location. But actually the circle of progress bar constantly spins and has never stoped
  5. Force quit Docker DEsktop
  6. Restart Docker Desktop. It make DockerDesktop/Docker.raw file in designated location but Docker Desktop starting... doesn't finish...
tegnike commented 1 year ago

Above 4 situation スクリーンショット 2023-09-04 10 45 15

korobochkin commented 1 year ago

Confirming the same issue on the following system:

The "Disk Image Location" setting doesn't work. The new location folder is always empty. Also if I change the "Virtual Disk Limit" for example, I see that the size of the default folder (/Users/$USER/Library/Containers/com.docker.docker) is changed. Restarting OS or Docker engine doesn't have any effect. Deleting the default folder also leads to it's recreation on the default location and not on a new path.

Almost zero documentation, big tech company and such a result... Cannot believe.

jackofsometrade commented 1 year ago

Downgrading to 4.16.2 did not work for me. Docker still locks up after applying the disk image location change.

I'm at a loss. Will I have to buy a new computer just to use Docker? I'm out of disk space. What alternatives are there?

Edit: after restarting docker 3x, magically it's working.

Edit 2: It seems like Docker (maybe MacOS Monterey in general) has issues with ExFAT filesystems, switching to APFS resolved issues such as incorrect no space left on device

mushroomlb commented 1 year ago

Almost zero documentation, big tech company and such a result... Cannot believe.

wahyudotdev commented 1 year ago

Downgrading to 4.16.2 did not work for me. Docker still locks up after applying the disk image location change.

I'm at a loss. Will I have to buy a new computer just to use Docker? I'm out of disk space. What alternatives are there?

Edit: after restarting docker 3x, magically it's working.

Edit 2: It seems like Docker (maybe MacOS Monterey in general) has issues with ExFAT filesystems, switching to APFS resolved issues such as incorrect no space left on device

I've got this working on my macbook m1 using SSD

image

Using APFS as its format

image
pre commented 1 year ago

Related https://github.com/docker/for-mac/issues/6797

rydan commented 1 year ago

Has this EVER worked? I've bug reported this years ago. It was just ignored then, and seems to be now as well.

Also, if you symlink to the volume instead, it kind of works, but if you try to update/change size to the image, the image goes corrupt and docker dies really really hard, like having to manually dig through and remove config files because "reset to defaults" crashes docker hard...

korobochkin commented 1 year ago

I think it might not work because of macOS security limitations... I saw that Google Drive also doesn't allow changing the location setting for file streaming because of the "file provider" (https://support.google.com/drive/answer/12178485) and the Google Drive for macOS doesn't allow change the location in settings (it becomes gray).

metafoo commented 1 year ago

Moving to my preferred location and then adjusting it in /Users/[user]/Library/Group Containers/group.com.docker/settings.json worked for me :)

Jovemp commented 1 year ago

Mudar para o local da minha preferência e ajustá-lo /Users/[user]/Library/Group Containers/group.com.docker/settings.jsontrabalhado para mim :)

As you did

shamsmm commented 1 year ago

Moving to my preferred location and then adjusting it in /Users/[user]/Library/Group Containers/group.com.docker/settings.json worked for me :)

Yes this finally worked on the latest version 4.25.1 I was going nuts because I had no free space on internal ssd but I had an external one which I bought MAINLY because I wanted to save and download and run much more containers.

lxsedov commented 1 year ago

issue still present on version 4.25.1

"fix" that worked for me: change -Disc image location- to your external disk (APFS) drag the allocated space slider to minimum a message saying something like "your existing containers will be removed" should pop up accept Docker.raw should be recreated on your external disk

shamsmm commented 1 year ago

issue still present on version 4.25.1

"fix" that worked for me: change -Disc image location- to your external disk (APFS) drag the allocated space slider to minimum a message saying something like "your existing containers will be removed" should pop up accept Docker.raw should be recreated on your external disk

Interesting because I did the same thing but docker would just create an empty folder called DockerDesktop and that's it, I had to override settings.json to a location in the external ssd and only then it created Docker.raw (It was writing at full write speed on ssd for a couple of minutes also)

panosangelopoulos commented 1 year ago

What i tried and make it work,

hint: The deamon.json file exists unde ~/.docker/deamon.json

rmeske commented 1 year ago

I have encountered a similar problem with version 4.25.2 on MacOS ventura.

In my case after changing the location and clicking Apply & restart, it did not hang. It looked like everything worked but when I do a build it is still using the old location. I tried exiting Docker Desktop and then restarting and found it reverted back to the original location. So it seems that the setting is not actually saved.

I tried setting data-root in the ~/.docker/daemon.json and when I started the Docker Desktop it created a number of files & folders but the Engine startup hung and after several attempts at restarting and rebooting I still could not get the Engine to start successfully. I removed the data-root from the json file and the Engine started correctly.

At this point I will try using a symlink instead.

rmeske commented 1 year ago

Update: I now have it working without having to use a symlink.

Below is what I did, but not sure if the first two are really needed:

  1. Used Clean/Purge data
  2. Used Rest to factory defaults
  3. I changed the Disk image location to an empty folder on the external drive
  4. Did Apply & restart - This did not make any changes in the folder on the external drive.
  5. Changed the size of the Virtual disk limit.
  6. Did Apply - This created the DockerDesktop folder and the Docker.raw file
  7. Quit Docker Desktop
  8. Relaunched Docker Desktop
  9. The Engine took a long while to start and while it was starting there was a lot of activity on the external drive so I left it alone. After about 15 minutes the Engine finally started and I was able to build images and start containers all running from the external drive.

Because the external drive is not an SSD and is several years old the slowness is to be expected. Now that I know it does work, I have ordered a new SSD drive with a faster transfer rate.

I am running running MacOS ventura and the latest version of Docker Desktop.

rmeske commented 1 year ago

I received my new SSD drive and have simplified the steps that work to move the Disk image location to an external USB drive. To reiterate, I am running MacOS Ventura and Docker Desktop 4.25.2.

  1. If you plan to use the external drive for more than just the Dove image, create an empty folder for the image.
  2. With the Docker Engine running, go to settings in Docker Desktop
  3. Go to Resources and select Advanced if it isn't already.
  4. Scroll down to Disk image Location
  5. Select browse and select the empty folder to store the Disk image
  6. Click Apply & restart
  7. Go back to your empty drive and open your folder. You should find another folder in it called DockerDesktop. If you don't try quitting the Desktop App.
  8. Create an empty file in the DockerDesktop folder called Docker.raw. This seems to be a requirement to get this to work.
  9. Go back to Docker Desktop and Settings.
  10. Select Resources and Advanced again.
  11. Scroll down to Virtual disk limit and change the size. This is the important part, it needs to be set to a number different then what it was.
  12. Click Apply & restart

It may take a while for the Docker Engine to start. The larger the image, the longer it takes. This is also true with the speed of your drive and the transfer rate. With USB 3 SSD and a transfer rate of 1000mb it took 3-4 minutes for a 100GB image.

Feature Request: What would be beneficial is to know how to change the location of the Disk Image without needing to go through Settings in Docker Desktop. I would like to keep a separate external drive for each client.

Ncage1974 commented 1 year ago

Moving to my preferred location and then adjusting it in /Users/[user]/Library/Group Containers/group.com.docker/settings.json worked for me :)

thank you so much this is the only thing that worked for me. I did a lot of the recommendations here and nothing worked but this. I even uninstalled / reinstalled ect.... Just to let everyone know i had to go to the original location & delete the Docker.raw file because that was taking up space. Moving the location didn't move / delete the original file.

nothing2obvi commented 11 months ago

@robert914 Thank you so much for solution! It worked for me.

jnussbaum commented 9 months ago

Similar problem in Docker Desktop version 4.28.0 (139021), on Mac OS Sonoma 14.3.1.

In the GUI, Docker seems to accept the new disk image location. "Apply & restart" works without problems. But the file is not created at the new location, and after a restart of Docker Desktop, the "Disk Image Location" in the GUI is again at the old location.

Finally, after a lot of hassle, this workaround solved my problem: https://github.com/docker/for-mac/issues/6803#issuecomment-1822152639

It would be nice if this bug could be fixed by docker!

rjoost commented 7 months ago

issue still present on version 4.25.1

"fix" that worked for me: change -Disc image location- to your external disk (APFS) drag the allocated space slider to minimum a message saying something like "your existing containers will be removed" should pop up accept Docker.raw should be recreated on your external disk

I know it's been months since you posted this but you just saved me lots of time. It worked! Thanks!

pedrosimao commented 1 month ago

I am facing the same issue on version 4.34.3. I managed to set the location on a NAS drive editing the settings.json file manually. Then I tried to make the disk image bigger and everything freezes again. Super annoying issue.

Gords commented 2 weeks ago

I solved this by resizing the virtual disk limit to the minimum in the docker desktop settings. Image