Container Registry works with EventBridge to provide the event notification feature. If you want to receive notifications about status changes that occur during image replication, image building, image scans, delivery chain execution, or image signing, you can use the DingTalk, an HTTP gateway, or an HTTPS gateway.
Prerequisites
-
A Container Registry Enterprise Edition instance is created. For more information, see Create a Container Registry Enterprise Edition instance.
-
EventBridge is activated. For more information, see Activate EventBridge and grant permissions.
Precautions
-
The event notification feature for Container Registry (ACR) is not available in the China (Shanghai) Finance, China (Shenzhen) Finance, China (Hangzhou) Finance, China (Beijing) Ali Gov 1, and UK (London) regions.
-
The maximum number of event rules allowed for a region is 10. You can create up to 10 event rules in EventBridge and Container Registry separately. If the maximum number is reached, you can remove event rules that are no longer needed.
-
Only events within three days can be queried by event ID in EventBridge.
-
When you use DingTalk to send event notifications, each DingTalk chatbot can send a maximum of 20 messages to the group per minute due to the limits of DingTalk chatbots. If the number of event notifications exceeds 20, the DingTalk chatbot is throttled for 10 minutes. For more information,seeCustom Robot Access。
-
After you create an event rule in Container Registry, you can modify the information of the event rule such as the notification type in EventBridge. For more information, see Modify event targets.
ImportantIf you modify an event rule in EventBridge, and then modify the event rule in Container Registry, the default event rule in Container Registry overwrites the event rule in EventBridge. For example, if you modify the event notification template in EventBridge, and then modify the effective scope of the event rule in Container Registry, the default event notification template in Container Registry overwrites the event notification template in EventBridge. The modification of the event notification template in EventBridge is not synchronized to Container Registry and does not take effect.
Step 1: Create a DingTalk chatbot
You need to perform this step only if you use DingTalk to send notifications.
-
Open the DingTalk group chat to which you want to add a chatbot and click the
icon in the upper-right corner. -
On the Group Settings panel, click Group Assistant.
-
In the Group Assistant dialog box, click Add robot, and then click the
icon next to Add robot. -
In the ChatBot dialog box, click Custom.
-
In the Robot details dialog box, click Add.
-
On the Add robot panel, enter a name for the robot, select Sign and I have read and agree to the "Custom Robot Service and Disclaimer", and then click Complete. Click Complete again.
-
In the ChatBot dialog box, click the
icon next to the robot that you created.In the Settings dialog box, copy the webhook address and signing key, and then click Complete.
Step 2: Create an event rule
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the left-side navigation pane of the instance details page, choose .
-
On the Event Rules tab, click Create Rule.
-
In the Event Scope wizard, configure the parameters and click Next.
Parameter
Description
Rule Name
Specify the name of the event rule.
Event Type
Specify the type of the event that triggers event notifications. The following event types are supported:
-
cr:Artifact:SynchronizationCompleted: An image synchronization succeeds, fails, or is canceled.
-
cr:Artifact:BuildCompleted: An image build succeeds, fails, or is canceled.
-
cr:Artifact:ScanCompleted: An image scan succeeds or fails.
-
cr:Artifact:DeliveryChainCompleted: The processing of a delivery chain succeeds, fails, is canceled, or is denied.
-
cr:Artifact:SigningCompleted:: Image tagging succeeds or fails.
This topic uses image scanning as an example. Select Image Scan Completed, and then select the Completed checkbox.
Effective scope
Specify the effective scope of the event:
-
Instance: Set the regular expression for image tags. An event notification is triggered when an image tag in the Enterprise Edition instance meets the regular expression.
-
Namespace: Select a namespace and set the regular expression for image tags. An event notification is triggered when an image tag in the namespace meets the regular expression.
-
Repository: Select a namespace and a repository, and then set the regular expression for image tags. An event notification is triggered when an image tag in the image repository meets the regular expression.
-
-
In the Event Notification wizard, configure the notification method and click Save.
You can select DingTalk, HTTP, or HTTPS as a notification method.
-
DingTalk: Set Notification Method to DingTalk, and then enter the webhook address and tagging key. In this example, the DingTalk notification method is used.
-
HTTP: Set Notification Method to HTTP and then enter the HTTP address.
-
HTTPS: Set Notification Method to HTTPS and then enter the HTTPS address.
After an event rule is created in Container Registry, an event rule of the same name is automatically created in the default event bus of EventBridge. The event rule in EventBridge uses the default DingTalk notification template.
After an image scan succeeds, the DingTalk group receives the following notification.

-
Related operations
This section describes how to view event traces.
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the left-side navigation pane of the instance details page, choose .
-
On the Event Notification page, click the Event History tab, and then click View Details for the target event ID.
-
In the EventBridge console, on the Query by Event ID tab, find the target event ID and click Event Trace in the Actions column.
In the Event Trace dialog box, you can view event reception and delivery details.