Reputation: 183
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
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:
Create a Pub/Sub topic $ gcloud alpha pubsub topics create projects/[PROJECT-ID]/topics/gcr
Create a pub/sub subscription gcloud alpha pubsub subscriptions create [SUBSCRIPTION-NAME] --topic=gcr
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
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