Try the Docker environment on AWS ECS

Overview

This is a post about the specific usage of AWS services that I tried to use for acquiring AWS qualifications. This time, we will try using Docker on AWS and Amazon ECS (Amazon Elastic Container Service). You can publish a web application using Docker in about 15 minutes.

See below for the article on how to study for the qualification exam.

AWS Beginners Study when AWS Certified Solutions Architect-Associate Qualification Exam AWS Beginners AWS Certified Solutions Architect-Study Method When Passing Professional Qualification Exam

To be able to

Approximate working time

Required knowledge

Outline of procedure

Let's do it. That said, all you have to do is follow the wizard in the ECS Start Now menu. First, to explain only the big picture, the concept of ECS is

image.png

As shown in the figure, there are four types, ** Container definition **, ** Task definition **, ** Service **, and ** Cluster **, which are set on three screens according to the wizard.

OK, let's get started. Click the initial screen of ECS or ** Start Now ** on the cluster to start.

image.png Or image.png Click ** Start Now ** to get started. (1st click)

Container definition/Task definition settings

Set the Container definition and Task definition on the first screen. In the container definition, httpd, nginx and tomcat are provided by default. (Select httpd this time) Both the container definition and task definition have a ** edit ** button on the upper right, and some parameters can be customized. For the time being, leave the default and click ** Next **. (2nd click)

image.png

Service settings

Next is the service settings. It seems that ALB can be incorporated as a ** load balancer **, but for the time being, leave ** none ** and click ** next **. (3rd click)

image.png

Cluster settings

Finally, the cluster settings. However, since it is only ** cluster name **, leave the default and click ** Next **. (4th click)

image.png

confirmation screen

A confirmation screen will be displayed. Confirm it and click ** Create **. that's all! ** Click 5 times ** to complete the creation! !!

image.png

Creation screen

It seems that CloudFormation is used internally, so if you do your best to make it from VPC and there is no problem, it will be created in a few minutes.

image.png After a few minutes ... image.png

Let's click ** View Services **. You can check the created VPC, subnet, and security group information.

image.png

Click ** Created Task ** from the ** Tasks ** tab

image.png

Since ** public IP ** is assigned, http: // {assigned public IP} / I will try to access it with.

image.png

If ↓ is displayed, you have created it without any problem. The web application has been published on AWS ECS!

image.png

As an entity, it is as follows defined in the container definition.

image.png

Yes, 5 clicks are complete. After that, let's tinker with container definitions etc. ^ ^

Supplement 1: Setting the container image of your own Web application

It seems that you can easily publish a web application just by specifying the container image of the http (80 port) web application created by yourself with ** custom ** of the Container definition setting.

image.png Set the container image on the opened screen image.png

Supplement 2: Delete the created Web application

You can easily do this from ** Delete Cluster ** in the ** Cluster ** menu. Since we are using CloudFormation, everything from the VPC to the task definition of the container is completely deleted.

image.png

Summary

It was much easier to create than I had imagined. If it is left as it is, the default settings will remain, so in the future I will take a closer look at the settings etc. (^^)

Recommended Posts

Try the Docker environment on AWS ECS
Run the AWS CLI on Docker
Build an environment with Docker on AWS
Environment construction command memo with Docker on AWS
Docker the development environment of Ruby on Rails project
Try Docker on Windows 10 Home
Install docker on AWS EC2
Install Docker on AWS Ubunt 20.04 LTS
Try using Redmine on Mac docker
To beginners launching Docker on AWS
Rails on Docker environment construction procedure
Build Unity development environment on docker
Easily try C # 9 (.NET 5) on Docker
Try using the service on Android Oreo
Try running Word2vec model on AWS Lambda
Use docker in proxy environment on ubuntu 20.04.1
Build Java 8 development environment on AWS Cloud9
Build Redmine code reading environment on Docker
Build an Ultra96v2 development environment on Docker 1
Try Alfresco 6.0 on Windows (Docker will be introduced at the same time)
I tried migrating the portfolio created on Vagrant to the Docker development environment
Try running MPLS-VPN with FR Routing on Docker
Try running ScalarDB on WSL Ubuntu (Environment Construction)
Try to build Java8 environment on Amazon Linux2
Liberty on Docker
Just install Laravel8 on docker in PHP8 environment
Try Azure Service Fabric (Java) on Mac-Local Environment
Improve the performance of your Docker development environment
Try running OSPF with FR Routing on Docker
Building OpenPose (Pytorch_Realtime_Multi-Person_Pose_Estimation) environment on Docker: training part
Build a Laravel environment on an AWS instance
Run Docker environment Rails MySQL on Heroku. devise and hiding the twitter API
Docker environment construction
Redmine on Docker
Temporarily move Docker environment from Mac to AWS
Now that you have deployed AWS with Rails On Docker, let's organize the contents.
[AWS] What are ECR and ECS? About each difference and how to operate Docker on AWS.
Memo to build a Servlet environment on AWS EC2
Build a Ruby on Rails development environment on AWS Cloud9
Deploy laravel using docker on EC2 on AWS ① (Create EC2 instance)
List how to learn from Docker to AKS on AWS
Setting up the FreeBSD desktop environment on Ubuntu + qemu
Run the Android emulator on Docker using Android Emulator Container Scripts
[First team development ③] Share the development environment created with Docker
A command that definitely cleans the local docker environment
SSL in the local environment of Docker / Rails / puma
Build WordPress environment with Docker (Local) and AWS (Production)
Try to build a Java development environment using Docker
Make the strongest Laravel development environment (Docker) Japan time
Command to try using Docker for the time being
Debug the VSCode + Docker + PHP development environment with XDebug.
Creating a lightweight Java environment that runs on Docker
Try using the query attribute of Ruby on Rails
Try DisplayLink on Ubuntu 20.04
Docker installation on CentOS 6
Try OpenLiteSpeed on CentOS8
python notes on docker
Install Docker on Manjaro
Try actions on GitHub [actions]
M.S. docker on Windows
Docker installation on WSL2