This topic describes how to create an Elastic Container Instance (ECI) by using CentOS images. You can use default values and minimal configurations in certain settings.
The ECI and Resource Access Management (RAM) services are activated. A RAM role related to ECI is assigned to your account.
Specifically, you must define the command used to start a container.
- Go to the ECI purchase page.
- Select the region and zone where you want to deploy the ECI. For more information
about the supported regions and zones, see Regions and zones.
Note We recommend that you select the latest zone that has sufficient resources to meet your business needs.
- Select a Virtual Private Cloud (VPC) and a VSwitch in the selected region and zone.
The information about the network, such as the Classless Inter-Domain Routing (CIDR)
block, appears on the page. If no VPC or VSwitch is available in the selected region
and zone, create a VPC on the VPCs page or create a VSwitch on the VSwitches page in the VPC console.
- Select a security group.
If no security group is available, create one on the Security Groups page in the Elastic Compute Service (ECS) console. A security group acts as a virtual firewall that provides the stateful packet inspection (SPI) and packet filtering features and is used to isolate security domains on the cloud. You can configure security group rules to enable or disable the access to the Internet or internal network and the access between ECIs for ECIs in the security group.To enable the access from the Internet to an ECI in a VPC, you must expose the corresponding ports in security group rules. For example, when you deploy the NGINX service, you must expose port 80 to the Internet in a security group rule.Note For more information about security groups, see Security group overview.
- Select an image.
After you specify the name of the container group and the name of a container, select an image from the Common Image repository and select the image version.
- Select the CPU and memory specifications for the container group.
Select appropriate CPU and memory specifications for each container. A container supports a minimum of 0.25 vCPU and 0.5 GB memory.
- Required. Define the command used to start a container.
To guarantee the proper running of CentOS, you must define the command used to start a container. For example, you can define the command as
- Confirm the configuration.
Click Preview on the purchase page. On the configuration preview page that appears, verify that the configuration is correct and click Create ECI to submit the order.
Result of not defining a startup command
If you do not define the command used to start a CentOS-based container and you set the restart policy to Always, the container keeps restarting and stays in the Waiting state.