我正在尝试让
Gitlab在本地运行并遇到权限问题:
cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied
我正在运行的命令是
sudo docker run \
--hostname local.gitlab \
--publish 443:443 --publish 80:80 --publish 2200: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-ce:latest
如果我省略了–volumes参数,则前一个命令会成功.
我试过跑步
docker exec -it gitlab update-permissions
docker restart gitlab
但这似乎也没有让事情奏效.
docker ps的输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
aa0654ff45e2 gitlab/gitlab-ce:latest "/assets/wrapper" 29 seconds ago Up 3 seconds (health: starting) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:2200->22/tcp gitlab
来自docker的输出记录gitlab:
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=10.3.2-ce.0
Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:
docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
If this container fails to start due to permission problems try to fix it by executing:
docker exec -it gitlab update-permissions
docker restart gitlab
Installing gitlab.rb config...