You create task definition which is used to run the docker image as a task on the ECS cluster.
-
Goto the AWS Elastic Container Services (ECS) console and click on the Task Definitions menu in the left and then click on the Create new Task Definition button.
-
On the next screen, select EC2 option and click on the Next step button.
-
On the next screen, type in dojotask as the task name. Select None for the task role. Select default for the network mode.
-
On the same screen, type in 128 for the task memory and 2 vcpu for the task cpu. Click on the Add container button.
-
On the add container popup, type in dojocontainer as the container name. Copy-paste docker image URI in the Image field. Type in 128 for the memory hard limit. Type in 80 for both host port and container port. Keep tcp for the protocol and click on the Add button.
-
The container gets added to the task definition. Finally, click on the Create button.
-
The task definition is created in no time. In the next step, you configure service for the ECS cluster.