How to Deploy a Docker App to AWS using Elastic Container Service (ECS)


    In this step by step tutorial, I show you how to deploy a Flask based Docker app to AWS. We start by building a local docker image and uploading it to Elastic Container Registry. We create an ECS Cluster, and configure a task to run our docker image. Finally, we launch a Task into the cluster and expose the app to the internet via VPC.

    00:10 Example Overview
    02:15 Application Walkthrough
    04:34 Creating a ECR Repository
    05:16 Uploading your Image to ECR
    06:28 Creating an ECS Cluster
    09:10 Creating a ECS Task Definition
    11:35 Running a Task on your Cluster
    13:03 Testing our app

    Want the docker file used in this video? Check out Tutorial (about a third down the page).
    How to install the AWS CLI –
    Source Code + Policy Template –

    Become a Patron:

    Clean Code –
    Clean Architecture –
    Head First Design Patterns –
    Domain Driver Design –
    Code Complete –
    The Pragmatic Programmer –
    Algorithms –
    Working Effectively with Legacy Code –
    Refactoring –

    Shure SM58 Microphone –
    Behringer UM2 Audio Interface –
    XLR Cable –
    Acoustic Sound Absorbing Foam Panels –
    Desk Microphone Mount –
    Logitech C920s Webcam –
    Fujilm XS10 Camera –
    Fujifilm XF 35mm F2 Lens –
    Neewer 2 Piece Studio Lights –

    Dell 34 inch Ultrawide Monitor –
    Autonomous ErgoChair 2 –
    Autonomous SmartDesk 2 Standing Desk –
    MX Master 3 Productivity Mouse –
    Das Keyboard Prime 13 MX Brown Mechanical-
    Veikk A15 Drawing Tablet –

    📚 References:
    Getting started with AWS:

    ☁Topics covered include:
    Flask App
    Elastic Container Registry
    Elastic Container Service

    🌎 Find me here:
    Twitter –
    Instagram –
    Patreon – Donations help fund additional content –



    Previous articleMenjalankan Aplikasi Container di AWS dengan Amazon EKS | Tedy Tirtawidjaja | AWS Indonesia
    Next articleWhat is AWS Elastic Load Balancer (ELB) | AWS ELB Tutorial | Intellipaat


    1. For anyone getting this error: CannotStartContainerError: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:338: getting the final child's pid from pipe caused: read init-p: connection reset by peer: unkno

      The cause is there's not enough memory assigned for your Task. If you followed along to the video, in task definition, change memory from 1 to 512 and CPU to 512 as well. Hope it helps

    2. Man! I wanna hug you! I suffered for about a month through bullshitery guides from amazon on how to do it! But you explained it so simply! Now I will need to make a pipeline with autodeploy. I hope you'll have videos on that topic. THANK YOU once again for such clear explanation.

    3. Hello, it's very strange I have done exactly the same and i have this error:

      CannotStartContainerError: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: container init was OOM-killed (memory limit too low?): unknown

    4. Great tutorial, I have a question. I have a similar set-up and wonder if there is any way to handle clients loosing connection each time you make a deployement? E.g every time I deploy the users that were authenticated and signed in to the site gets kicked out since the container with redis gets cleared

    5. Hi great video. I followed this along but got stuck where the task was pending status. Can you show me how you fixed it exactly? I was following exactly what you were doing.. I don’t know what typo you made.. is that container name ?