skip to Main Content

I currently use Cloud Build to build my app as a Docker image based on a Dockerfile. All this works fine.

However, I would like to build/push an existing image (without a Dockerfile): quay.io/soketi/soketi:1.0-16-debian

How can I instruct Cloud Build to tag/push the above Docker image hosted on quay.io?

Once I push the image, I will create a Cloud Run based on the socket image.

Thank you

2

Answers


  1. I would create an image from the Dockerfile containing one line:

    FROM quay.io/soketi/soketi:1.0-16-debian
    

    and push it (submit) with a desired tag.

    Login or Signup to reply.
  2. You can do it directly by pulling the image, add the new tag and push it to the new registry in one step:

    steps:
    - name: 'gcr.io/cloud-builders/docker'
      entrypoint: 'bash'
      args:
      - '-eEuo'
      - 'pipefail'
      - '-c'
      - |-
        docker pull quay.io/soketi/soketi:1.0-16-debian && 
        docker tag quay.io/soketi/soketi:1.0-16-debian gcr.io/PROJECT_ID/soketi:1.0-16-debian && 
        docker push gcr.io/PROJECT_ID/soketi:1.0-16-debian
    

    Of course you can change the registry and only if you want to re-tag the image

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search