All Products
Search
Document Center

Container Registry:CreateRepoBuildRule

Last Updated:Aug 27, 2026

Creates an image building rule for a repository.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the instance.

cri-xkx6vujuhay0****

RepoId

string

Yes

The ID of the image repository.

crr-8dz3aedjqlmk****

DockerfileLocation

string

No

The path of the Dockerfile.

/

DockerfileName

string

No

The name of the Dockerfile.

Dockerfile

PushType

string

Yes

The type of the push that triggers the building rule. Valid values:

  • GIT_TAG: tag push

  • GIT_BRANCH: branch push

GIT_BRANCH

PushName

string

Yes

The name of the push that triggers the building rule.

master

ImageTag

string

Yes

The tag of the image.

v0.9.5

BuildArgs

array

No

Building arguments.

string

No

Building arguments.

UserName=Test

Platforms

array

No

Architecture for image building. Valid values:

  • linux/amd64

  • linux/arm64

  • linux/386

  • linux/arm/v7

  • inux/arm/v6

Default value: linux/amd64

string

No

Architecture for image building. Valid values:

  • linux/amd64

  • linux/arm64

  • linux/386

  • linux/arm/v7

  • inux/arm/v6

Default value: linux/amd64

linux/amd64

Response elements

Element

Type

Description

Example

object

Code

string

The return value.

success

IsSuccess

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

RequestId

string

The ID of the request.

4CE1F661-75DD-4EBD-A4AD-057B26834ABB

BuildRuleId

string

The ID of the building rule.

crbr-ly77w5i3t31f****

Examples

Success response

JSON format

{
  "Code": "success",
  "IsSuccess": true,
  "RequestId": "4CE1F661-75DD-4EBD-A4AD-057B26834ABB",
  "BuildRuleId": "crbr-ly77w5i3t31f****"
}

Error codes

HTTP status code

Error code

Error message

Description

500 SystemError Unknown error.
403 NoPrivilege Access denied for this user.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.