官术网_书友最值得收藏!

Configuring a Container definition

The Amazon ECS wizard gets started. A diagram of ECS objects gets displayed, as shown in Chapter 1Getting Started with Amazon ECS and Amazon Fargate. By default, the Fargate launch type is used. First, the container definition is to be defined, followed by the task definition. 

A Task definition consists of one or more container definitions. Most of the attributes are defined in the container definition, but a few are defined at the task level. To start with, select a container definition template, including the image, from one of those listed, which include sample-app and nginx, or create a custom container definition.

  • Click on Configure for the custom container definition, as shown in the following screenshot, to create a new custom container definition:
  • The Edit container dialog gets displayed. The standard configuration for a container includes the fields discussed in the following table:
  • Specify a Container name (hello-world). Click on the i icon to display a callout for the container name. The container name must be up to 255 characters (uppercase and lowercase, numbers, hyphens, and underscores).
  • Next, specify a Docker Image (tutum/hello-world). The image name must be up to 255 characters (uppercase and lowercase, numbers, hyphens, underscores, colons, periods, /, and number signs). The Fargate launch type only supports images in the Amazon ECR or public repositories in Docker Hub.
  • Next, specify the Memory Limits in MiB. Two memory limits may be specified: Soft limit and Hard limit. Either or both may be specified. The effect of specifying one or both is discussed in this table:
  • The dropdown for the Memory Limits lists both the Hard Limit and the Soft limit. The Soft limit default value, is 128 MiB. To add a hard limit on memory in addition to a soft limit, click on the Add Hard Limit link. A Hard limit gets added. Memory Limits are shown as follows. The Soft limit (128 MiB) is less than the Hard limit (256 MiB):
  • Next, specify the Port mappings. With the Fargate launch type, exposed ports must be specified as container ports. Container port 80 is specified as follows. The host port is the same as the Container port by default, and cannot be set to a different value with the awsvpc network mode that the Fargate launch type uses:
  • Optionally, specify Advanced container configuration, which consists of configuration for Environment, Network settings, Storage & Logging, Resource Limits, and Docker Labels. While the memory and CPU configuration is required at the task definition level, it is optional at the container level. The only requirement is that the total amount of memory for all containers within a task must not exceed the memory configured for the task, and the total amount of CPU for all containers within a task must not exceed the CPU configured for the task. A container instance has 1,024 CPU units for every CPU core. If the Essential checkbox for a container is checked, the failure of the container returns in the entire task failing. At least one container in a task must be set as the essential container, which implies that if a task has only one container, it must be essential, as shown here:
  • The only network mode supported by the Fargate launch type is awsvpc. The only supported log configuration and log driver for the Fargate launch type is awslogs. Click on Update after configuring the custom container, shown as follows:
  • A Container definition for the hello-world custom container gets added as follows:
主站蜘蛛池模板: 邮箱| 社会| 隆昌县| 仪征市| 当涂县| 河西区| 荔浦县| 铁岭市| 布拖县| 磴口县| 巴彦淖尔市| 孟连| 德阳市| 丽水市| 安龙县| 晴隆县| 凤山市| 广州市| 文山县| 北安市| 华安县| 阳江市| 湟源县| 乾安县| 深圳市| 双桥区| 民勤县| 星子县| 南靖县| 宜春市| 阿拉善右旗| 安多县| 台南县| 绥江县| 康马县| 西宁市| 眉山市| 郸城县| 衢州市| 郎溪县| 黑龙江省|