nilse
nilse

Reputation: 183

Does Google cloud image repository send out notifications on any push/pull of images on/from the repository?

The docker repository provides notifications to an endpoint, when any image is push/pulled from a private repository (https://docs.docker.com/registry/notifications/#configuration). Does Google Cloud image repository provide some similar notification mechanism? The document talks about publisher application which will publish the message to pub-sub, but it is not clear to me - 1)whether GCR will directly publish the message to pub-sub 2) if not, if I have to write an publisher application how will it get know about any changes on my repository. I might be missing something really rudimentary here, please help me understanding the flow.

Upvotes: 0

Views: 565

Answers (1)

Pauloba
Pauloba

Reputation: 564

You can use Cloud Pub/Sub: https://cloud.google.com/pubsub/docs/overview

Yes Cloud Registry messages will be publised to Cloud Pub/Sub.

The steps to follow to use Cloud Pub/Sub notifications with Docker are:

  1. Create a Pub/Sub topic $ gcloud alpha pubsub topics create projects/[PROJECT-ID]/topics/gcr

  2. Create a pub/sub subscription gcloud alpha pubsub subscriptions create [SUBSCRIPTION-NAME] --topic=gcr

  3. Configuring Pub/Sub access controls in the GCP Console's IAM page https://cloud.google.com/pubsub/docs/access-control#console You can use one of the following roles: Owner, Editor, PubSub/Admin, PubSub/Editor, PubSub/Publisher, PubSub/Subscriber

  4. The Container Registry notifications will be shown in the pub/sub section withing your project.

You can check this documentation on how to configure Cloud Pub/Sub notifications https://cloud.google.com/container-registry/docs/configuring-notifications

Here is a quickstart guide to understand better how Cloud Pub/Sub works https://cloud.google.com/pubsub/docs/quickstarts

Upvotes: 1

Related Questions