How to install on macOS with Docker?

On Mojave trying to install Gitlab EE through Docker. I code almost entirely for statistical packages. So I’m lost in the programming instructions of how to properly setup the GitLab. i installed Docker and first ran

docker pull gitlab/gitlab-ce

sudo docker run --detach
–hostname gitlab.example.com
–publish 443:443 --publish 80:80 --publish 22:22
–name gitlab
–restart always
–volume /srv/gitlab/config:/etc/gitlab
–volume /srv/gitlab/logs:/var/log/gitlab
–volume /srv/gitlab/data:/var/opt/gitlab
gitlab/gitlab-ee:latest

Just like the instructions describe. But I get an error I’m seeing a lot online but still can’t find the fix. It outputs the error message:
docker: Error response from daemon: Mounts denied:
The paths /srv/gitlab/data and /srv/gitlab/logs and /srv/gitlab/config
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker → Preferences… → File Sharing.
See Change Docker Desktop settings on Mac | Docker Docs for more info.

thanks. I must be doing something blatantly wrong.

Hi @asheikhp and welcome to the GitLab forum!

Sorry for the confusion.
On macOS, there will be no /srv/gitlab/ path found.
You’ll want to use /Users/Shared instead of /srv.

Try again with:

sudo docker run --detach 
–hostname gitlab.example.com 
–publish 443:443 --publish 80:80 --publish 22:22 
–name gitlab 
–restart always 
–volume /Users/Shared/gitlab/config:/etc/gitlab 
–volume /Users/Shared/gitlab/logs:/var/log/gitlab 
–volume /Users/Shared/gitlab/data:/var/opt/gitlab 
gitlab/gitlab-ee:latest

That should work for you! Let me know how it goes.

All the best,
Greg

2 Likes

Hi Greg, I had the same issue as asheikhp. I followed you advice and it installed just fine. However, I can’t seem to get it up and running. I’m attaching an excerpt from the logs I’m seeing in Docker. If you or anyone else has any advice, I would very much appreciate it.

Hi,

please add some more details on your system, like

  • macOS version
  • Docker for Mac version

Also, please attach the logs as text, you can enclose them with 3 backticks for better readability,

```
log line 1
log line 2
```

From a first peek, it looks like the filesystem is read only.

I’ve tried this on macOS Catalina 10.15.2, Docker Desktop 2.2.0.0 (42247), Docker engine 19.03.5, and it works for me.

docker run -d -h gitlab.example.com -p 8443:443 -p 880:80 -p 822:22 --name gitlab --restart always -v /Users/Shared/gitlab/config:/etc/gitlab -v /Users/Shared/gitlab/logs:/var/log/gitlab -v /Users/Shared/gitlab/data:/var/opt/gitlab gitlab/gitlab-ee:latest

Maybe you’ll need to purge/reset the Docker setup, or reinstall Docker itself. IIRC I had to do that when upgrading to Catalina.

Cheers,
Michael

Hi Michael,

Thank you so much for jumping in to help! The forum wouldn’t allow me to attach a .txt file, which is why I resorted to screen shots. I get a message saying that the only allowed files are things like .jpg, jpeg, .gif, .png, .ico

I’m running MacOS Catalina 10.15.2, although I do need to put in the most recent update. I’m running Docker Desktop Community edition, 2.2.0.0 (43347), engine 19.03.5. I installed Docker last year but recently updated it. Yes, I updated to Catalina after Docker had been installed, so that might be the issue.

Your Docker command looks very similar to mine. I used slightly different ports, but it otherwise looks the same.

Let me see if I can attach a .txt file now that I’ve established that I’m not a robot/hacker. Eh, no luck. I’m attaching that error message - not that it’s particularly relevant.

Let me uninstall Docker and re-install it. Maybe that will fix the problem.

Thank you again.