在gitlab ci中拒绝访问资源

时间:2017-07-20 19:45:23

标签: docker gitlab-ci

我正在玩gitlab持续集成的可能性,想要构建并推送一个简单的docker镜像。

这是.gitlab-ci.yml文件:

image: docker:latest

services:
  - docker:dind

stages:
- deploy

dockerhub:
  stage: deploy
    - docker build --pull -t registry.gitlab.com/yvnicolas/test-node -f Docker/Dockerfile .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
    - docker push registry.gitlab.com/yvnicolas/test-node

构建本身没问题,但无法推送访问拒绝消息。这是工作追踪的结束

Successfully built 8b99fc09ac4c
Successfully tagged registry.gitlab.com/yvnicolas/test-node:latest
$ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
Login Succeeded
$ docker push registry.gitlab.com/yvnicolas/test-node
The push refers to a repository [registry.gitlab.com/yvnicolas/test-node]
a936d383687d: Preparing
62ef757d064b: Preparing
5dda7fb6dd53: Preparing
72c708771a73: Preparing
099f37abad88: Preparing
d7bd42f1f660: Preparing
8b375be9de19: Preparing
0f8361255952: Preparing
71ce2dc7f761: Preparing
0d960f1d4fba: Preparing
8b375be9de19: Waiting
0f8361255952: Waiting
71ce2dc7f761: Waiting
d7bd42f1f660: Waiting
0d960f1d4fba: Waiting
denied: requested access to the resource is denied
ERROR: Job failed: exit code 1

我不明白这里有什么不对...... 这是Project on gitlab

1 个答案:

答案 0 :(得分:1)

您的图片名称应为registry.gitlab.com/yvnicolas/ci-node-docker-sandbox:latest而不是registry.gitlab.com/yvnicolas/test-node:latest