'trouble installing gitlab docker image. permission denied error

I am trying to build gitlab using docker and keep getting this error message.

cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied

it looks like GITLAB_OMNIBUS_CONFIG is the issue.

I don't know how to resolve the issue. Please help!



Solution 1:[1]

It depends when you are getting the error message: on docker build or docker run.

In the latter case (runtime), you would need to mount your user folder (where you have the right to write) to GitLab container, as in here:

    --volume /Users/username/gitlab/config:/etc/gitlab \
    --volume /Users/username/gitlab/logs:/var/log/gitlab \
    --volume /Users/username/gitlab/data:/var/opt/gitlab \

Official documentation:

Set up the volumes location

Before setting everything else, configure a new environment variable $GITLAB_HOME pointing to the directory where the configuration, logs, and data files will reside.

Ensure that the directory exists and appropriate permission have been granted.

For macOS users, use the user’s $HOME/gitlab directory:

export GITLAB_HOME=$HOME/gitlab

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC