简体   繁体   中英

How to publish a build on Google Cloud Build to Google Container registry using yaml file

I have a yaml file that builds the image. The image was successfully built using the github trigger where I got the confirmation as follows:

Successfully built cd57cea98cac
Successfully tagged gcr.io/my-project/quickstart-image:latest
PUSH
DONE

It also says the push is done though I don't know if it means the push to Google Container registry since I cannot find that image on the project's Google Container registry.

This is the yaml file I used to build it:

steps:
- name: 'gcr.io/cloud-builders/docker'
  env:
    - 'ACCESS_TOKEN=$ACCESS_TOKEN'
  args:
    - build
    - "--tag=gcr.io/my-project/quickstart-image"
    - "--file=./twitter/dax/processing_scripts/Dockerfile"
    - "--build-arg=ACCESS_TOKEN=${ACCESS_TOKEN}"
    - .

Is there anything I am missing to push it to Google Container registry since I cannot see the image on GCR.

I figured out the answer to my own question.

I had missed out the image step that would push it to Google Container registry.

steps:
- name: 'gcr.io/cloud-builders/docker'
  env:
    - 'ACCESS_TOKEN=$ACCESS_TOKEN'
  args:
    - build
    - "--tag=gcr.io/my-project/quickstart-image"
    - "--file=./twitter/dax/processing_scripts/Dockerfile"
    - "--build-arg=ACCESS_TOKEN=${ACCESS_TOKEN}"
    - .
images:
- 'gcr.io/my-project/quickstart-image'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM