Creates an image build rule for an image repository.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRepoBuildRule

The operation that you want to perform. Set the value to CreateRepoBuildRule.

DockerfileLocation String Yes /

The directory of the Dockerfile.

DockerfileName String Yes Dockerfile

The name of the Dockerfile.

ImageTag String Yes 2

The tag of the image.

InstanceId String Yes cri-xkx6vujuhay0tqas

The ID of the instance.

PushName String Yes master

The version number of the Git repository where the Dockerfile resides.

PushType String Yes GIT_BRANCH

The version type of the Git repository where the Dockerfile resides. Valid values: GIT_TAG and GIT_BRANCH.

RegionId String Yes cn-shanghai

The ID of the region.

RepoId String Yes crr-8dz3aedjqlmkrasd

The ID of the repository.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The return value.

RequestId String 2E055A30-F4BA-4B34-BC95-276CDAF5935D

The ID of the request.

BuildRuleId String crbr-rbfghsymk0qs7aaa

The ID of the image build rule.


Sample requests

http(s)://[Endpoint]/? Action=CreateRepoBuildRule
&<Common request parameters>

Sample success responses

JSON format


XML format


Error codes

For a list of error codes, visit the API Error Center.