Running docker image on Amazon AWS


  1. (optional) to connect to the cluster (running instance) you have to create security keys. to create them go to:
    1. click Services -> EC2
    2. in left menu select "Key pairs" (NETWORK & SECURITY)
    3. click "Create key pair" and the keys are created
    4. copy created key content to your computer and store them properly (store private key)
  2. create Cluster : click Services -> Elastic Container Service -> Clusters -> Create Cluster
    1. name your cluster 
    2. select EC2 instance type for your purpose (free is only t2.micro)
    3. select key pair if you would like to connect to cluster over SSH (optional but it is recommended)
    4. click Create
  3. create task role to use it in creating new task:
    1. click Services -> IAM
    2. in left menu select "Roles"  and "Create Role"
    3. trusted entity: select "EC2 Container Service" -> "EC2 Container Service Task"  and click Next
    4. click Next 
    5. name role and create it
  4. create Task Definition: click Services -> Elastic Container Service -> Task Definitions -> Create a Task Definition
    1. name your new task
    2. select "Task Role" created in step 3
    3. "Add container": 
      1. name it
      2. in image input "Repository URI" (Repositories -> click your repository and you will see URI value)
      3. insert memory (for free must all tasks have less than 1G)
      4. insert other container properties. Like ports (Container Port is port on docker image), ... and click Add
    4. click "Create" to create task definition
  5. run it. Select created task and from "Actions" select run task. 

Comments

Popular posts from this blog

Deploy docker image to Amazon AWS (free for 12months) in half an hour for beginners

Connecting to running docker image AWS Amazon