我正在尝试在gitlab中使用无人机。在将Docker映像推送到我的私有注册表的步骤之前,它会引发错误:
Successfully built 7afb99118ae2
Successfully tagged ae872a846df0d8df884e89bd3a77cacf49b8f7de:latest
+ /usr/local/bin/docker tag ae872a846df0d8df884e89bd3a77cacf49b8f7de :latest
Error parsing reference: ":latest" is not a valid repository/tag: invalid reference format
我的无人机是无人机/无人驾驶飞机:1.0.0-rc.3
这是我的.drone.yml文件
kind: pipeline
name: default
steps:
- name: build
image: python:3.6
commands:
- pip install -r requirements.txt
- python -m pytest app.py
when:
branch:
- master
event:
- push
- pull_request
- name: publish
image: plugins/docker
registry: registry.cn-beijing.aliyuncs.com
repo: registry.cn-beijing.aliyuncs.com/xxx/xxx
tags: latest
username:
- from_secret: ali_username
password:
- from_secret: ali_password
还有我的Dockerfile
FROM python:3.6-alpine
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ADD . /code
WORKDIR /code
CMD ["python", "app.py"]
我已经尝试过这些:
tags: latest
tags: 1
tags: [1, 1.1]
tags: [1, 1.1, latest]
tags:
- latest
甚至删除tags
行,但没有任何效果。
这是怎么了?谢谢你的提示!
答案 0 :(得分:0)
您的yml文件中的某个地方tag value
设置为空,但是docker tag
命令中有:
。
查看图片以产生上述错误。
我没有使用drone.io,但是您的yml文件中存在缩进或配置问题,设置下的标签也是如此,
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
username: kevinbacon
password: pa55word
repo: foo/bar
tags: latest