大佬教程收集整理的这篇文章主要介绍了运行 Cloud Build 时 GCP 无效的参考格式,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
你好 StackOverflow 偷看。
在尝试创建 Google Cloud Platform CI/CD 管道并在测试部分卡住时寻求帮助。我有以下 Dockerfile 创建图像,当我推送到 github 存储库时会触发这些图像:
FROM node:alpine as builder
workdir /usr/app
copY package.Json .
RUN npm install
copY . .
RUN npm run build
# Run phase
FROM Nginx
copY --from=builder /usr/app/build /usr/share/Nginx/HTML
然后我使用以下 cloudbuild.yaml
文件构建容器,将其推送到我的存储库,并尝试运行我拥有的纱线测试:
# Start cloudbuild
# we just want to install and run tests for Now
steps:
# build the docker image
- name: gcr.io/cloud-builders/docker
ID: buildinstaller
args:
[
"build","-t","gcr.io/$PROjeCT_ID/docker-react-ci:$BRANCH_name-$SHORT_SHA","-f","Dockerfile","."
]
# this step pushes the image to Container Registry
- name: "gcr.io/cloud-builders/docker"
ID: Push
args:
- "push"
- "gcr.io/$PROjeCT_ID/docker-react-ci:$BRANCH_name-$SHORT_SHA"
# fires the jest tests of the app so far
- name: 'gcr.io/cloud-builders/docker'
ID: test
args:
- "run"
- "-e"
- "CI=true"
- "gcr.io/$PROjeCT_ID/docker-react-ci:$BRANCH_name-$SHORT_SHA"
- "npm"
- "run"
- "test"
- "--"
- "--coverage"
Cloud Build Logs 的输出是:
starTing build "f06de889-d88f-480d-bb51-9734cdf9447a"
FETCHsourcE
Initialized empty Git repository in /workspace/.git/
From https://github.com/landon-sturgeon/docker-react
* branch 3daf6a3fc0bf951b2b4de1a06d75fdeef9178e8b -> FETCH_head
head is Now at 3daf6a3 hard code the right project name again
BUILD
StarTing Step #0 - "buildinstaller"
Step #0 - "buildinstaller": Already have image (with digest): gcr.io/cloud-builders/docker
Step #0 - "buildinstaller": Sending build context to Docker daemon 921.1kB
Step #0 - "buildinstaller": Step 1/8 : FROM node:alpine as builder
< INSTALLS CONTAINER CORRECTLY REMOVED LOGS FOR BREVITY >
Step #0 - "buildinstaller": successfully tagged gcr.io/docker-react-306100/test:latest
Finished Step #0 - "buildinstaller"
StarTing Step #1 - "Push"
Step #1 - "Push": Already have image (with digest): gcr.io/cloud-builders/docker
Step #1 - "Push": The push refers to repository [gcr.io/docker-react-306100/test]
Step #1 - "Push": 446f1465778a: Preparing
Step #1 - "Push": 2acf82036f38: Preparing
Step #1 - "Push": 9f65d1d4c869: Preparing
Step #1 - "Push": 0f804d36244d: Preparing
Step #1 - "Push": 9b23c8e1e6f9: Preparing
Step #1 - "Push": ffd3d6313c9b: Preparing
Step #1 - "Push": 9eb82f04c782: Preparing
Step #1 - "Push": ffd3d6313c9b: WaiTing
Step #1 - "Push": 9eb82f04c782: WaiTing
Step #1 - "Push": 9b23c8e1e6f9: Layer already exists
Step #1 - "Push": 9f65d1d4c869: Layer already exists
Step #1 - "Push": 2acf82036f38: Layer already exists
Step #1 - "Push": 0f804d36244d: Layer already exists
Step #1 - "Push": ffd3d6313c9b: Layer already exists
Step #1 - "Push": 9eb82f04c782: Layer already exists
Step #1 - "Push": 446f1465778a: Pushed
Step #1 - "Push": latest: digest: sha256:26172522a0d7199af3e8b044f0fa73d9efed0ed278b7af16062b00060369b96a size: 1780
Finished Step #1 - "Push"
StarTing Step #2 - "test"
Step #2 - "test": Already have image (with digest): gcr.io/cloud-builders/docker
Step #2 - "test": /usr/bin/docker: invalID reference format: repository name must be lowercase.
Step #2 - "test": See '/usr/bin/docker run --Help'.
Finished Step #2 - "test"
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/docker" Failed: step exited with non-zero status: 125
这是我一直坚持的 /usr/bin/docker: invalID reference format: repository name must be lowercase
错误。我已经尝试对 repo 名称进行硬编码,但我仍然遇到相同的错误。不知道从这里开始该怎么做,但希望大神们能进来拯救这一天!
谢谢!
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的运行 Cloud Build 时 GCP 无效的参考格式全部内容,希望文章能够帮你解决运行 Cloud Build 时 GCP 无效的参考格式所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。