jamesvillarrubia
jamesvillarrubia

Reputation: 101

Volume Mounting in local OSX gitlab-runner for exec docker

I'm trying to test my gitlab-ci.yml file by running the jobs through gitlab-runner on my laptop (OSX). The yml looks like

image: ruby:2.2
start:
  script:
  - echo "made it"

The executor is docker. I've tried:

gitlab-runner --debug exec docker start
gitlab-runner --debug exec docker --docker-volumes /users/Shared/Sites/Werk/werk-mailer:/users/Shared/Sites/Werk/werk-mailer 

And a many other paths and flags, but no luck. I keep getting this message:

ERROR: Job failed (system failure): Error response from daemon: Mounts denied: 
The path /users/Shared/Sites/Werk/werk-mailer
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Upvotes: 1

Views: 678

Answers (2)

murb
murb

Reputation: 1858

An alternative fix for a related problem, although it doesn't seem to be apparent from the initial question: I found that Docker tried to locate a folder all in lower case. Docker runs linux, which is case sensitive, whereas MacOS's file system is not case sensitive :/ I simply created a new self-owned directory /development (sudo mkdir /development && sudo chown {username}:staff /development) and symlinked my project's folder there (cd /development && ln -s {path to project}) and added /development to the list of folders Docker for macOS has access to. Running the gitlab runner from that point worked for me.

Upvotes: 0

jamesvillarrubia
jamesvillarrubia

Reputation: 101

So apparently either gitlab-runner or docker only mounts the /Users/ folder. The /Users/Shared folder (in which I share repos with other accounts) is not added.

I moved my repo into /Users//Sites/ and it was fine.

Upvotes: 1

Related Questions