Google Container Registry (GCR)

Use GCR with pipeline integrations

Configure GCR (Google Container Registry) as your Docker registry provider.

Set up GCR integration

Before you begin

How to

  1. In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Pipeline Integrations.
  2. Select Docker Registries and then click Configure.
  3. From the Add Registry Provider dropdown, select Google Container Registry.
  4. Define the following:
    • Registry name: A unique name for this configuration.
    • Domain: Select the domain, for example, us.gcr.io. Make sure the domain does not include suffixes such as the URL path. Configuring the domain as us.gcr.io/my_org is incorrect and will cause builds to fail.
    • JSON Keyfile: The content of the generated JSON key file.

Google Container Registry (GCR) settings

Google Container Registry (GCR) settings

`

  1. To verify the connection details, click Test Connection.
  2. To apply the changes, click Save.

Generate a JSON key file

The JSON key file holds your credentials for a given service account.
To generate your key file follow these instructions:

  1. Go to your Cloud Platform Console Credentials page.
  2. Select the project that you’re creating credentials for.
  3. To set up a new service account, click Create credentials, and then select Service account key.
  4. Choose the service account to use for the key.
  5. Choose to download the service account’s public/private key as a JSON file.

You can find the complete guide here.

Working with multiple projects

If you have more than one repository/project in Google cloud, you can connect multiple GCR registries and define one as the “primary” for the gcr.io domain.

This means that every time Codefresh needs to pull an image it will use that integration. If you wish to use another project for pulling images, you can use the registry_context property as described in working with multiple registries.

Docker registries for pipeline integrations
Working with Docker Registries
Push step
Building and pushing an image