All Products
Search
Document Center

Create a container group with CentOS images

Last Updated: Aug 13, 2019

This topic describes how to create a container group with CentOS images by using the default or minimal settings for some parameters.

Preparations

You must have activated the Elastic Container Instance (ECI) and Resource Access Management (RAM) services. In addition, you must have assigned an RAM role to the ECI service.

Specifically, you must grant the permission to use the container startup command in CMD.

Click here to see how to use the container startup command. Specifically, you need to specify the container startup command in CMD for base images, such as CentOS and BusyBox.

Procedure

Go to the ECI sales page

Go to the ECI sales page.

Step 1: Select a region and a zone

Select the region and zone where you want to deploy the container group. For more information about the supported regions and zones, see Regions and zones.

We recommend that you choose the most recent zones that meet your business requirements, as these have more resources.

portal-01 Select a region

Step 2: Select a VPC and a VSwitch

After you select a VPC and a VSwitch in the region and zone, the CIDR block and other information about the VPC are displayed on the page. If no VPC or VSwitch is available in the region and zone, create a VPC and a VSwitch in the console.

Click here to see how to create a VPC.

Click here to see how to create a VSwitch.

portal-02 Select a VPC

Step 3: Select a security group

Select a security group for the VPC. A security group is a virtual firewall that provides state detection and data packet filtering and isolates security zones in the cloud. You can set rules for a security group to allow or disallow access to the public or private network from container groups in the security group as well as access between different container groups.

To allow access to container groups in a VPC from the public network, you need to expose the corresponding service ports in the security group rules. For example, if an NGINX container is deployed in a container group, you need to allow access to port 80 from the public network in the security group rule.

Click here for more information about security groups.

portal-04 Security groups

Step 4: Select an image

Set names for the container group and the containers in the group. Then, select the image type and version from the image repository.

portal-05 CentOS image

portal-05 CentOS version

Step 5: Select the number of vCPUs and memory size for the container group

Select the number of vCPUs and memory size for the container group. The minimum specifications are 0.25 vCPUs and 0.5 GB memory.

portal-05 Specifications of CentOS images

(Important) Step 6: Specify the container startup command in CMD

To ensure the proper operation of CentOS, you must specify the container startup command in CMD. The simple form of the command issleep 999999.

portal-06 CentOS startup command

Step 7: Confirm the configuration

Click Confirm Configuration. On the page that appears, verify that the configuration is correct, and then click Create ECI to submit the order.

portal-07 Create a container group with the CentOS image

Container groups without the startup command specified

If you do not specify the startup command for the CentOS-based container group and set Restart Policy to Always, the container group keeps attempting to start and stays in the Waiting state.

portal-10 Startup failure of container groups with CentOS images