All Products
Search
Document Center

Elastic Container Instance:CommitContainer

Last Updated:Oct 17, 2025

Call the CommitContainer operation to create an asynchronous task that saves a specified container in an Elastic Container Instance (ECI) instance as an image and pushes the image to an image repository in Alibaba Cloud Container Registry (ACR).

Operation description

Before you call the CommitContainer operation, prepare an ACR image repository. Then, create a Resource Access Management (RAM) role and grant the required permissions. For more information, see Create an image from a container and push it to an ACR 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eci:CommitContainer

create

*CommitContainerTask

acs:eci:{#regionId}:{#accountId}:containergroup/*

  • eci:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region.

cn-hangzhou

RegionId

string

Yes

The ID of the region.

cn-hangzhou

ContainerGroupId

string

Yes

The ECI instance for which you want to create a CommitContainer task.

eci-bp1do4xz75fa5sd****

ContainerName

string

Yes

The name of the container that you want to use to create the image.

container-1

Image

object

No

The information about the container image.

Repository

string

Yes

The address of the ACR image repository.
For security reasons, you can push images only to ACR.

registry-vpc.cn-beijing.aliyuncs.com/test/test-****

Tag

string

Yes

The tag of the image. If you leave this parameter empty, the tag is not modified.

0.0.6

Message

string

No

The description of the image.

test commit

Author

string

No

Specifies the author of the image.

alice

AcrRegistryInfo

object

No

The access credential configurations for the ACR Enterprise Edition instance.

Note

You do not need to configure this parameter if you use an ACR Personal Edition instance. You must configure this parameter if you use an ACR Enterprise Edition instance.

InstanceId

string

No

The ID of the ACR Enterprise Edition instance.

cri-nwj395hgf6f3****

RegionId

string

No

The region where the ACR Enterprise Edition instance is located.

cn-hangzhou

ArnService

string

No

In a cross-account authorization scenario, this is the Alibaba Cloud Resource Name (ARN) of the RAM role of the user who is granted permissions.

acs:ram::1609982529******:role/role-test

ArnUser

string

No

In a cross-account authorization scenario, this is the ARN of the RAM role of the user who grants the permissions.

acs:ram::1298452580******:role/role-test

Arn

object

No

The ARN information required for authorization.

RoleArn

string

No

The ARN of the authorization role.

acs:ram:xxx

RoleType

string

No

The authorization type. Set the value to service to use a RAM role for authorization.

service

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. This ID is unique.

CB8D2B22-D636-4182-****-1FC9DBDAD66F

TaskId

string

The ID of the task.

t-bp18cwvrb3v9tjk0tekz

Examples

Success response

JSON format

{
  "RequestId": "CB8D2B22-D636-4182-****-1FC9DBDAD66F",
  "TaskId": "t-bp18cwvrb3v9tjk0tekz"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter %s
403 InvalidVolumeType The specified volumeName is invalid, only volume of cloud disk support capacity resize
403 IncorrectStatusDetail %s
403 InvalidAction The specified action is invalid

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.