Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
    • Overview
    • Container
    • Invoking a container
    • Runtime environment
    • Networking
    • Mounting external resources to a container file system
    • Long-lived containers
    • Container termination notifications
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Yandex Cloud Logging
      • Trigger for Yandex IoT Core
      • Trigger for budgets
      • Trigger for Data Streams
      • Email trigger
    • Dead Letter Queue
    • Container logs
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Events for setting up a trigger
  • Filtering events
  • Batching
  • Roles required for the proper operation of a trigger for Container Registry
  • Container Registry trigger message format
  • See also
  1. Concepts
  2. Trigger
  3. Trigger for Container Registry

Trigger for Container Registry that invokes a Serverless Containers container

Written by
Yandex Cloud
Updated at August 22, 2024
  • Events for setting up a trigger
    • Filtering events
  • Batching
  • Roles required for the proper operation of a trigger for Container Registry
  • Container Registry trigger message format
  • See also

A trigger for Container Registry invokes a Serverless Containers container when specific events occur with a Container Registry Docker image. The trigger must be in the same cloud as the registry whose events it is subscribed to.

A trigger for Container Registry needs a service account to invoke the container.

For more information about creating a trigger for Container Registry, see Creating a trigger for Container Registry that invokes a Serverless Containers container.

Events for setting up a triggerEvents for setting up a trigger

Events with Docker images that can be tracked using a trigger:

  • Creating a Docker image.
  • Delete Docker images.
  • Creating a Docker image tag.
  • Deleting a Docker image tag.

A Docker image is always pushed with a tag (if no tag is specified, Docker automatically inserts the latest tag). Therefore the CreateImage event is always paired with CreateImageTag. You can add an arbitrary number of tags to a Docker image by pushing the same image with other tags. In this case, only the CreateImageTag event will occur, without CreateImage.

A tag can go from one Docker image to another. This happens when pushing a new Docker image with a tag that is already used in another Docker image. In this case, the CreateImage event will occur for the new Docker image, while changing the tag will trigger two events: DeleteImageTag (removing the tag from the old Docker image) and CreateImageTag (assigning the tag to the new Docker image).

When you delete a Docker image, all its tags are deleted. This is why deleting a Docker image always triggers the DeleteImage event and as many DeleteImageTag events as the Docker image had tags at the time of deletion.

Filtering eventsFiltering events

Events are filtered using tags and names of Docker images that you push. When using a name and tag at the same time, filtering is done based on the logical AND: for the trigger to work, the image must match both the name and tag.

BatchingBatching

Batching settings allow you to simultaneously send multiple events to a container. They set a top limit on the size of an event group and its accumulation time. For example, if the size of an event group is 3, the container can receive groups with 1 to 3 events.

Roles required for the proper operation of a trigger for Container RegistryRoles required for the proper operation of a trigger for Container Registry

  • To create a trigger, you need:
    • Permission for the service account under which the trigger executes the operation. This permission comes with the iam.serviceAccounts.user and editor roles or higher.
    • The container-registry.images.puller role for the registry whose events are processed by the trigger.
  • To run a trigger, the service account needs the serverless.containers.invoker role for the folder with the container to be invoked by the trigger.

Read more about access management.

Container Registry trigger message formatContainer Registry trigger message format

After the trigger is activated, it sends the following message to the container:

{
  "messages": [
  {
    "event_metadata": {
      "cloud_id": "b1gvlrnlw2e6********",
      "created_at": "2020-09-07T11:09:14Z",
      "event_id": "crtpk611vb7g********",
      "event_type": "yandex.cloud.events.containerregistry.CreateImage",
      "folder_id": "b1g88tfl0pl8********",
      "tracing_context": {
        "parent_span_id": "-14915794679********",
        "span_id": "-72326631357********",
        "trace_id": "70e7m4n2********"
      }
    },
    "details": {
      "image_digest": "sha256:45f8f740272f1f2a053eade37d8d************************************",
      "image_id": "crti2c9b************",
      "registry_id": "crt2504s************",
      "repository_name": "crt2504s************/ubuntu",
      "tag": "latest"
    }
  }]
}

See alsoSee also

  • Trigger for Container Registry that invokes a Cloud Functions function
  • Trigger for Container Registry that sends messages to WebSocket connections

Was the article helpful?

Previous
Trigger for Object Storage
Next
Trigger for Yandex Cloud Logging
Yandex project
© 2025 Yandex.Cloud LLC