A container image contains the programs, libraries, and configurations required to run a containerized application.
Background
Before you create an Elastic Container Instance, you must upload a container image to an image repository. Elastic Container Instance (ECI) supports pulling images from image repositories such as Docker Hub and Alibaba Cloud Container Registry (ACR). ACR helps you build, distribute, and manage your container images. For more information, see What is Container Registry?.
Usage notes
If you pull an internet image and your VPC does not have a NAT gateway, you must associate an elastic IP address (EIP) with the Elastic Container Instance.
Configuration
API
When you call the CreateContainerGroup operation to create an Elastic Container Instance, you can use parameters such as Container.N.Image to configure the container image. For more information, see CreateContainerGroup.
|
Parameter |
Type |
Example |
Description |
|
Container.N.Image |
String |
registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest |
The image used by the container. |
|
InitContainer.N.Image |
String |
registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest |
The image used by the init container. |
For images from different sources, you must also configure the following parameters:
-
If your image is from a private image repository, you must use the
ImageRegistryCredentialparameters to configure the repository's access credential.Parameter
Type
Example
Description
ImageRegistryCredential.N.Password
String
yourpassword
The password for the repository.
ImageRegistryCredential.N.Server
String
registry-vpc.cn-hangzhou.aliyuncs.com
The registry endpoint of the repository.
ImageRegistryCredential.N.UserName
String
yourusername
The username for the repository.
-
If your image is from a Container Registry Enterprise Edition image repository, you can use the
AcrRegistryInfoparameters to pull images without a secret. For more information, see Pull images from a Container Registry instance without using a secret. -
If your image is from a self-managed repository that uses the HTTP protocol or a self-signed certificate, you must configure the
PlainHttpRegistryorInsecureRegistryparameter to avoid image pull failures. For more information, see Pull an image from a self-managed image repository.
Console
When you create an Elastic Container Instance on the Elastic Container Instance buy page, you configure the container on the Basic Settings page, where you can select one of the following image types:
-
Common Images: Open source test images provided by ECI for quick feature testing.
-
Docker Official Images: public images from Docker Hub.
-
My Images: images in your Container Registry Personal Edition image repositories.
-
Container Registry Enterprise Edition image: images in your Container Registry Enterprise Edition image repositories.
Common images include eci_open/nginx, eci_open/redis, eci_open/tomcat, eci_open/rabbitmq, and eci_open/fluentd.
If you use a private image (an image that is not publicly available from ECI, ACR, or Docker Hub), enter its address and tag in the image configuration section. Then, on the Other Settings (Optional) page, configure the repository's access credential.
In the Image Registry Credential section, enter the Server (for example, registry-vpc.cn-hangzhou.aliyuncs.com), Username, and Password. To configure multiple credentials, click Add Credential.