If you have not created a cluster before, create a cluster first. For information about how to create a cluster, see Create a cluster.
Log on to the Container Service console.
Click Applications in the left-side navigation pane, and click Create Application in the upper-right corner.
Complete the following configurations for the application you are about to create and then click Create with Image.
- Name: Enter the name of the application. Enter nginx in this example.
- Version: Enter the version of the application. By default, 1.0 is entered.
- Cluster: Select the cluster on which the application will be deployed.
- Update: The update method of the application. Select Standard Release or Blue-Green Release. For details, see Introductions on release strategies.
- Description: Enter the information of the application. The entered description will be displayed on the Application List page.
- Pull Docker Image: With this check box selected, Container Service pulls the latest Docker image from the repository to deploy the application, even when the image tag does not change.
To improve efficiency, Container Service caches the image. When deploying an application, Container Service uses the cached image instead of pulling the image from the repository if the image tag is the same as that of the local cache. Therefore, if you modify your codes and image but do not modify the image tag for the convenience of upper business, Container Service will use the old image cached locally to deploy the application. With this check box selected, Container Service ignores the cached image and re-pulls the image from the repository when deploying the application to ensure the latest image and codes are always used.
Click Select image.
Select nginx under the Popular tab and click OK.
Container Service uses the latest version of image by default. To use another version of image, click Select image version. The Image version dialog box appears. Select the version and click OK.
Configure the port mapping of host and container in Port Mapping. To enable access to the Nginx server in the container by means of public network, configure the Web Routing.
Click the plus icon next to Port Mapping and add two port mappings by entering 80 and 443 in the Container Port field respectively. The host port is not specified in this example.
Click the plus icon next to Web Routing.
Enter 80 in the Container Port field, indicating to access port 80 on the Nginx container.
Enter nginx in the Domain field. Only the domain name prefix nginx is entered. If the domain name prefix is
XXX, you get the domain name
XXX.$cluster_id.$region_id.alicontainer.comfor test. In this example, you get the test domain name
Note: You can also enter your own domain name. For how to add your own domain name, see Add domain names to services exposed to the public network. For how to configure the container port and HTTP service domain name for the routing, see routing. For information about how the routing service forwards requests to the container, see Expose HTTP services by means of acsrouting.
Click Create at the right of the page. Container Service creates the application nginx according to the preceding settings.
A page indicating the application is created appears. Click View Application List or Back to Application List on the page or click Applications in the left-side navigation pane. Click the application name nginx to view the application details.
Click the service name nginx under Services to view the service details.
Click the access endpoint of the service nginx.
The Nginx server default welcome page is displayed.
Note: If you cannot access this page, see Access link troubleshooting.