Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cloudbuild] support for images #61

Open
bradrydzewski opened this issue Mar 29, 2023 · 0 comments
Open

[cloudbuild] support for images #61

bradrydzewski opened this issue Mar 29, 2023 · 0 comments
Labels
cloudbuild Google Cloud Build conversion target enhancement New feature or request

Comments

@bradrydzewski
Copy link
Member

bradrydzewski commented Mar 29, 2023

Google Cloud Build has a setting that pushes images on the machine to their registry
https://cloud.google.com/build/docs/build-config-file-schema#images

The images field in the build config file specifies one or more Linux Docker images to be pushed by Cloud Build to Container Registry. You may have a build that performs tasks without producing any Linux Docker images, but if you build images and don't push them to the registry, the images are discarded on build completion

steps:
- name: 'gcr.io/cloud-builders/docker'
 args: ['build', '-t', 'gcr.io/myproject/myimage', '.']
images: ['gcr.io/myproject/myimage']

In order for this to work for the cloud runtime:

  1. mount /var/run/docker.sock into steps
  2. add step that performs docker login
  3. add step that runs docker push for the specified images

In order for this to work for the kubernetes runtime:

  1. mount /var/run/docker.sock as a shared volume
  2. create a docker-in-docker background step
  3. append a step that executes docker login
  4. append a step that executes docker push for the specified images
@bradrydzewski bradrydzewski added enhancement New feature or request cloudbuild Google Cloud Build conversion target labels Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloudbuild Google Cloud Build conversion target enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant