2017-12-30 12 views
4

내가 Gitlab가 로컬로 실행 및 권한 문제로 실행하고 얻으려고에 고정 표시기와 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 logs 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... 
cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied 

내가 맥 OS 시에라 10.12.6

에있어 어떤 도움을 주시면 감사하겠습니다!


업데이트

나는 this answer에 따라 폴더 사용 권한을 수정 한, 사물 추가를 따라 조금있다,하지만 지금은 새로운 권한 오류를 얻고있다. 내가 Get Infochmod하지만 성공을 사용하여 /etc/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 

Preparing services... 
Starting services... 
Configuring GitLab package... 
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted 
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system 
gitlab preinstall: 
gitlab preinstall: This node does not appear to be running a database 
gitlab preinstall: Skipping version check, if you think this is an error exit now 
gitlab preinstall: 
Configuring GitLab... 
Starting Chef Client, version 12.12.15 
resolving cookbooks for run list: ["gitlab"] 
Synchronizing Cookbooks: 
- gitlab (0.0.1) 
- package (0.1.0) 
- registry (0.1.0) 
- mattermost (0.1.0) 
- consul (0.0.0) 
- gitaly (0.1.0) 
- runit (0.14.2) 
Installing Cookbook Gems: 
Compiling Cookbooks... 
Recipe: gitlab::default 
* directory[/etc/gitlab] action create 

    ================================================================================ 
    Error executing action `create` on resource 'directory[/etc/gitlab]' 
    ================================================================================ 

    Errno::EPERM 
    ------------ 
    Operation not permitted @ chmod_internal - /etc/gitlab 

    Cookbook Trace: 
    --------------- 
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:33:in `from_file' 

    Resource Declaration: 
    --------------------- 
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb 

    28: directory "/etc/gitlab" do 
    29: owner "root" 
    30: group "root" 
    31: mode "0775" 
    32: only_if { node['gitlab']['manage-storage-directories']['manage_etc'] } 
    33: end.run_action(:create) 
    34: 
    35: if File.exists?("/var/opt/gitlab/bootstrapped") 
    36:  node.default['gitlab']['bootstrap']['enable'] = false 
    37: end 
    38: 

    Compiled Resource: 
    ------------------ 
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:28:in `from_file' 

    directory("/etc/gitlab") do 
    action [:create] 
    retries 0 
    retry_delay 2 
    default_guard_interpreter :default 
    path "/etc/gitlab" 
    declared_type :directory 
    cookbook_name "gitlab" 
    recipe_name "default" 
    owner "root" 
    group "root" 
    mode "0775" 
    only_if { #code block } 
    end 

    Platform: 
    --------- 
    x86_64-linux 


================================================================================ 
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb 
================================================================================ 

Errno::EPERM 
------------ 
directory[/etc/gitlab] (gitlab::default line 28) had an error: Errno::EPERM: Operation not permitted @ chmod_internal - /etc/gitlab 

Cookbook Trace: 
--------------- 
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:33:in `from_file' 

Relevant File Content: 
---------------------- 
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb: 

26: include_recipe 'gitlab::config' 
27: 
28: directory "/etc/gitlab" do 
29: owner "root" 
30: group "root" 
31: mode "0775" 
32: only_if { node['gitlab']['manage-storage-directories']['manage_etc'] } 
33>> end.run_action(:create) 
34: 
35: if File.exists?("/var/opt/gitlab/bootstrapped") 
36:  node.default['gitlab']['bootstrap']['enable'] = false 
37: end 
38: 
39: directory "Create /var/opt/gitlab" do 
40: path "/var/opt/gitlab" 
41: owner "root" 
42: group "root" 

Platform: 
--------- 
x86_64-linux 


Running handlers: 
There was an error running gitlab-ctl reconfigure: 

directory[/etc/gitlab] (gitlab::default line 28) had an error: Errno::EPERM: Operation not permitted @ chmod_internal - /etc/gitlab 

Running handlers complete 
Chef Client failed. 0 resources updated in 05 seconds 

: 아래 docker logs gitlab의 출력이다.


내가 로컬 그냥 원격 개발 버전을 설정 실행 GL을 받고 포기 2

업데이트 부분입니다.

+0

볼륨이 비어 있거나 기존 데이터가 있습니까? –

+0

@ TarunLalwani 볼륨이 비어 있습니다. – mzmm56

답변

2

/srv/gitlab/config, /srv/gitlab/logs/srv/gitlab/data을 마운트하려고하는 호스트 폴더의 모든 사용자에게 읽기 및 쓰기 권한을 부여하면됩니다. Right Click > Get Info > Lock Icon.

이 문제는 mac의 File system sharing (osxfs)과 관련이 있으며 호스트와 컨테이너간에 파일 사용 권한을 유지하는 방법과 관련이 있습니다.

+0

그건 내 대답보다 정확 해 보입니다. +1 – VonC

+0

대단히 고맙습니다. 답변을 주셔서 감사합니다. (즉, 귀하의 제안이 효과가 있었음) 새로운 권한 오류가 발생했습니다./원래 질문을 'docker logs gitlab'의 새 출력으로 업데이트했습니다. '. 사용 권한 문제와 같은 것으로 보이지만 디렉토리를 수정하기 위해'정보 입수 '를 사용하는 것은이 경우에는 작동하지 않는 것 같습니다 – mzmm56