Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

docker - How to run cloud-build on local?

Follow the document, I ran

cloud-build-local --substitutions _ENV=${prod},_CLUSTER_NAME=${my_cluster},_CLUSTER_ZONE=${my_zone},_ISE_GCP_PROJECT=${my_project} --dryrun=false .

Got error

Using default tag: latest
latest: Pulling from cloud-builders/metadata
Digest: sha256:a83982a17dde3199640d8a35f6da80c01f5c764e9f4eb4bf80fa0a09e0f2aa13
Status: Image is up to date for gcr.io/cloud-builders/metadata:latest
gcr.io/cloud-builders/metadata:latest
2021/01/28 15:24:10 Started spoofed metadata server
2021/01/28 15:24:10 Build id = localbuild_a948dd97-3b4e-45ce-8cf9-f280dbf7eca9
2021/01/28 15:24:10 status changed to "BUILD"
BUILD
Starting Step #0 - "docker-build"
Step #0 - "docker-build": Already have image (with digest): gcr.io/kaniko-project/executor:debug
...
Step #0 - "docker-build": error pushing image: open /builder/outputs/images: operation not permitted
Finished Step #0 - "docker-build"
2021/01/28 15:24:34 Step Step #0 - "docker-build" finished
2021/01/28 15:24:35 status changed to "ERROR"
ERROR
ERROR: build step 0 "gcr.io/kaniko-project/executor:debug" failed: exit status 1
2021/01/28 15:24:36 Build finished with ERROR status 

The Dockerfile is

FROM docker.elastic.co/logstash/logstash:7.10.2

RUN set -ex; 
  ./bin/logstash-plugin install logstash-output-redis

...

cloudbuild.yaml is

steps:
  - id: docker-build
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: /busybox/sh
    args:
      - -c
      - |
        executor 
        --cache 
        --context ./ 
        --destination asia.gcr.io/$PROJECT_ID/my_app:$COMMIT_SHA 
        --destination asia.gcr.io/$PROJECT_ID/my_app:latest 
        --dockerfile Dockerfile

Which path it is? /builder/outputs/images I'm running it on macOS, tried to create a path /builder but got mkdir: /builder: Read-only file system.

question from:https://stackoverflow.com/questions/65933515/how-to-run-cloud-build-on-local

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...