Docker 构建失败:标记无效引用格式(Gitlab CI) [英] Docker build failed: tag invalid reference format (Gitlab CI)

查看:19
本文介绍了Docker 构建失败:标记无效引用格式(Gitlab CI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 gitlab 中为 Dockerfile 创建了一个 repo.在 .gitlab-ci.yml 我定义了两个阶段:构建和推送到注册表.

I've created a repo in gitlab for a Dockerfile. In the .gitlab-ci.yml i defined two stages: build and push to the registry.

这是 .gitlab-ci.yml 文件:

This is the .gitlab-ci.yml file:

image: docker

stages:
    - build
    - push

build:
    stage: build
    script:
      - docker build --no-cache -t ${DOCKER_REGISTRY}/debian9-cunit .

push:
    stage: push
    script:
      - docker push ${DOCKER_REGISTRY}/debian9-cunit

当我运行管道时,构建阶段失败说:

When I run the pipeline, the build stage fails saying:

-t, --tag"标志的无效参数/debian9-cunit":无效的参考格式

invalid argument "/debian9-cunit" for "-t, --tag" flag: invalid reference format

相同的代码(在/debian9-"之后只有一个不同的名称)在同事的另一个 repo 中没有问题.可能是什么问题?

The same exact code (with only a different name after "/debian9-") works with no problem in another repo of a collegue. What can be the problem?

推荐答案

问题已解决:我的个人公司资料中没有 GitLab 运行器.另一个项目属于一个共享跑步者的小组.

Problem solved: I didn't have a GitLab runner on my personal company profile. The other project was of a group that has a shared runner.

这篇关于Docker 构建失败:标记无效引用格式(Gitlab CI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆