All Products
Search
Document Center

Elastic Compute Service:(Optional) Create an image component

Last Updated:Dec 16, 2024

An image component stores one or more commands, such as application, configuration, and test commands, that you commonly use to build an image. You can add image components to an image template to quickly specify custom image content. The system provides predefined system image components. You can directly use the components. In specific scenarios or to meet specific requirements, you can create custom image components based on your business requirements. This topic describes how to create an image component in the Elastic Compute Service (ECS) console.

Note

Image templates that are created by using system image components provide stable and reliable images. We recommend that you use system image components to create image templates.

Limits

Take note of the following limits:

  • You cannot create or modify system image components. You can create or modify only custom image components.

  • The command content size cannot exceed 16 KB. An image component supports up to 127 commands. For information about commands supported by Image Builder, see Commands supported by Image Builder.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > icon1 > Image Builder.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. On the Image Builder page, click the Image Components tab.

    Note

    The first time you access Image Builder, the Image Builder welcome page appears. You must click Experience Now to go to the Image Builder page.

  5. Click the Custom Components tab, and then click Create Image Component.

  6. In the dialog box that appears, configure the parameters and click Confirm.

    The following table describes the parameters.

    Parameter

    Description

    Name

    Specify a name for the image component.

    Component Type

    Image build components and image test components are supported.

    • An image build component is used to specify custom image content and can be used only in image build templates.

    • An image test component is used to test whether an image can run as expected and can be used only in image test templates.

    System Type

    Select an operating system type for the image component. Linux and Windows are supported.

    Release Type

    The version number of the image component, which is used together with the name of the image component.

    Configure Component Content

    Linux operating systems support YAML Ain't Markup Language (YAML) commands and DockerFile commands. Windows operating systems support only YAML commands.

    • YAML

      • You can directly enter the command content in the YAML format.

      • You can also select a predefined template from the sample template drop-down list, such as the template used to install PHP, MySQL, or NGINX. If you select a predefined template for the image component, the latest stable version of an application, such as PHP, MySQL, or NGINX, is installed on ECS instances when you use an image created based on an image template that includes the image component to create the instances. If the version of an application does not meet your business requirements, you can install the version that you require. For example, you can change the sudo yum -y install nginx command to sudo yum -y install nginx-<version>.

      image

    • DockerFile

      You can click the Visual View tab and click Add Command to enter command parameters for each type of command, or click the Script View tab and enter the command content in the code editor.

      image

    For information about the YAML and DockerFile commands, see Commands supported by Image Builder.

    Advanced Settings

    Configure the description and labels of the image component based on your business requirements.

References