2017-04-14 94 views
0

我正在嘗試使用gitlab CI runner,但我確實遇到了嘗試使用令牌登錄的錯誤。Gitlab:docker通過令牌登錄失敗

$ docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 
Warning: failed to get default registry endpoint from daemon (Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/info: dial unix /var/run/docker.sock: connect: permission denied). Using system default: https://index.docker.io/v1/ 
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/auth: dial unix /var/run/docker.sock: connect: permission denied 
ERROR: Job failed: exit status 1 

我可以通過及時做docker login與我的用戶名/密碼,但不與令牌。我究竟做錯了什麼?

跑步者是一個貝殼跑步者。

gitlab-ci.yml

stages: 
    - build 
    - deploy 

before_script: 
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 
+0

不回答這個問題,但這裏有一個相關查詢:HTTP:/ /stackoverflow.com/questions/43248455/gitlab-runner-local-build-login-from-non-tty-device – Jawad

+0

不幸的是,沒有幫助:-( – user3142695

+1

你有沒有把你的用戶添加到Docker組? – kstromeiraos

回答

2

Gitlab亞軍並沒有設置爲泊塢窗組用戶

sudo usermod -aG docker gitlab-runner