All Products
Search
Document Center

Elastic Container Instance:Use an NGINX image to create an ECI instance

Last Updated:Jun 20, 2026

If you want to test the capabilities of Elastic Container Instance (ECI), you can use common images such as NGINX images provided by ECI. This topic describes how to pull an NGINX image over a virtual private cloud (VPC) and use the NGINX image to create an ECI instance.

Prerequisites

  • ECI and Resource Access Management (RAM) are activated. Your RAM role is granted the required permissions.

    Note

    If you create an ECI instance as a RAM user, you must grant the required permissions to the RAM user. For more information, see Grant permissions to a RAM user.

  • vSwitches and a VPC are created in the region where you want to create an ECI instance.

    • For information about the regions and zones where ECI is available, see Regions and zones.

    • For information about how to create a VPC and vSwitch, see Create and manage a VPC and Create and manage a vSwitch.

      Note

      We recommend creating multiple vSwitches. This way, you can select multiple vSwitches to implement the multi-zone feature when you create an ECI instance. This improves the success rate of instance creation.

  • A security group is created. For more information, see Create a security group.

    Security groups serve as virtual firewalls that provide Stateful Packet Inspection (SPI) and packet filtering capabilities to isolate security domains on the cloud. Each ECI instance must belong to a security group. For more information, see Assign a security group to an ECI instance.

Procedure

This section describes the key configurations and steps of pulling an NGINX image to create an ECI instance. For specific parameters, the minimal or default configurations are used.

  1. Go to the Elastic Container Instance buy page.

  2. Configure the basic information of the instance.

    1. Specify the billing method and type of the instance.

      Use the default settings. The billing method is pay-as-you-go, and the instance type is regular instance.

    2. Select the region in which you want to create the ECI instance.

    3. Select a VPC and a vSwitch.

      We recommend that you select multiple vSwitches to implement the multi-zone feature. The system preferentially creates the instance in a zone where inventory resources are sufficient.

    4. Select a security group. Security group rules allow or deny access for ECI instances to the public internet or within the VPC, and control access between IP addresses.

      Note

      If you want to access ECI instances in a VPC over the Internet, you must enable corresponding ports in the security group to which the ECI instances belong. For more information, see Add a security group rule.

  3. Configure the container group.

    1. Specify specifications for the container group.

      In this example, the instance is created by using vCPU and memory specifications. This creation mode provides better elasticity and resource provisioning capabilities. If your business requires special specifications, such as GPU-accelerated instances, you can specify corresponding Elastic Compute Service (ECS) instance types. For more information, see Specify ECS instance types to create an ECI instance.

    2. Enter a name for the container group.

    3. Select a restart policy.

      The default value is Always, which means the system automatically restarts the container after it exits.

  4. Set the Quantity parameter.

    If you purchase multiple container groups, a sequential suffix is automatically appended to the name of each container group. For example, if you set Name to test and Quantity to 3, the names of your container groups are test001, test002, and test003.

  5. Configure containers.

    1. Enter a name for the container.

    2. Select an image and an image tag.

      On the Common Images tab, select eci_open/nginx and set the version to 1.14.2.

      Note
      • The default image pulling policy (imagePullPolicy) is IfNotPresent, meaning the system first tries to use a local image and pulls a new one only if a local copy is unavailable.

      • Images whose source is ALI_HUB are stored in Alibaba Cloud image repositories. By default, the images are pulled over VPCs.

    Set the startup command. The command is nginx, and the arguments are -g and daemon off;.

    Important

    ECI does not support port mapping. The container ports that are exposed by default are enabled for instances. In the preceding example, port 80 is exposed by default on the NGINX image that you select. If the security group allows port 80, you can use the instance IP address and port number to access NGINX containers.

  6. Click Confirm Configuration.

  7. Confirm the instance configuration, read and select the terms of service, and then click Confirm Order.

    After the instance is created, you can view it on the Container Group page. Click the instance ID to view its details.