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

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:
主站蜘蛛池模板: 八宿县| 城步| 固原市| 丹巴县| 永修县| 普陀区| 盐山县| 中西区| 毕节市| 惠安县| 内丘县| 个旧市| 济阳县| 施秉县| 西吉县| 额尔古纳市| 安宁市| 方山县| 吉安市| 佛山市| 永春县| 张家界市| 津南区| 杭锦后旗| 磐安县| 饶平县| 蓝田县| 宜宾县| 色达县| 江油市| 兴义市| 韶关市| 凤阳县| 庆云县| 平阴县| 井研县| 许昌县| 汶上县| 进贤县| 容城县| 嘉黎县|