Docker构建失败:标记无效的参考格式(Gitlab CI) [英] Docker build failed: tag invalid reference format (Gitlab CI)
问题描述
我已经在gitlab中为Dockerfile创建了一个仓库. 在.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-"之后仅具有不同的名称)可以在同一个同事的另一个回购中正常工作. 可能是什么问题?
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屋!