for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Docker Desktop FAILS with user home directory on external drive

Open ronjonesjr opened this issue 3 years ago • 6 comments

  • [ x ] I have tried with the latest version of Docker Desktop
  • [ ] I have tried disabling enabled experimental features
  • [ ] I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Docker Desktop runs without a fatal error.

Actual behavior

Docker Desktop returns a fatal error trying to create a /Users/username directory on the OS drive. It should lookup and use the already present directory that macOS knows and is using.

In macOS you can move your home directory to an external drive quite easily (). Many of us do this if we purchase machines with limited hard disk space and already own fast external SSD drives. I have one of those machines. I then install Docker Desktop and try to run it and I get a Fatal Error - mkdir /Users/username: permission denied. Of course permission is denied because my home directory is not located at /Users/username! macOS knows where it is and uses it just fine. I think your mechanism for identifying the users home directory is flawed. This is a blocking bug for me as I have no way of moving my home directory back to the install disk.

At a terminal you can navigate perfectly to your home directory on an external drive via:

  1. Cd
  2. Cd ~

So macOS has no issue with the home directory being relocated. NSHomeDirectory() likely also returns the proper home directory. My guess is you have some code trying to emulate the home directory lookup and it “assumes” the home directory is hard coded to “/Users/username” which is the issue as that is an incorrect assumption.

Information

  • macOS Version: macOS Monterey 12.6.2
  • Intel chip or Apple chip: Apple Chip
  • Docker Desktop Version: 4.15.0 (93002)

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

Steps to reproduce the behavior

  1. Move your home directory off of the main disk to another drive. ( https://iboysoft.com/news/macos-move-home-folder-to-external-drive.html )
  2. Install and Run Docker Desktop

ronjonesjr avatar Jan 09 '23 13:01 ronjonesjr

You would think that you could use a symlink to point to the external user directory, but if you do that you'll put Docker Desktop into an infinite loop. See these related issues.

https://github.com/docker/for-mac/issues/6673 https://github.com/docker/for-mac/issues/6691

ronjonesjr avatar Jan 18 '23 22:01 ronjonesjr

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robott avatar Apr 18 '23 01:04 docker-robott

Same thing happens if you just rename your home folder. It's not clear how to address the issue - where is docker desktop configured to use my old home folder and how do I update it?

I tried resetting to factory defaults and that doesn't seem to address the issue.

hiddenist avatar May 19 '23 02:05 hiddenist

Having the same issue my user name change so my home directory is different then it was when I last had Docker Desktop installed. However I believe my old home directory was restored to the new home.

Cant be that hard to just tell us where the home directory path is configured.

chooven avatar May 30 '23 22:05 chooven

I was able to work around my issue by creating a symlink to the new home directory.

ln -s /newdir/myname /users/myname

hiddenist avatar May 31 '23 07:05 hiddenist

For me the solution was to edit ~/Library/Group\ Containers/group.com.docker/settings-store.json and change the location of the "hardcoded" user home directory (in my case from /Users/paul to /Volumes/SSD/Users/Paul)

Whilst there also changed to this "filesharingDirectories": [] (I removed the entries)

Obviously kill docker first before editing. Edit and then start docker.

bartlettpsj avatar Nov 20 '24 05:11 bartlettpsj