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

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:
主站蜘蛛池模板: 永定县| 六枝特区| 宣城市| 原阳县| 乌审旗| 长武县| 株洲县| 佛学| 博罗县| 锡林浩特市| 满洲里市| 凤城市| 湖北省| 丁青县| 香港 | 巴彦县| 聂荣县| 清流县| 南漳县| 崇州市| 万宁市| 奉节县| 梅河口市| 连江县| 金溪县| 宝应县| 黑龙江省| 鄂尔多斯市| 晴隆县| 屯昌县| 鹤山市| 禹城市| 嵊泗县| 台东市| 福海县| 老河口市| 台安县| 榆树市| 陇南市| 新丰县| 庆云县|