- Docker is a container platform to build, ship and run containerized applications. The four important components of Docker Engine are as follows:
- Containers: A read write template
- Images: A read only template
- Network: A virtual network for containers
- Volumes: A persistent storage for containers
- Docker CE can be installed on many platforms including Linux, Windows, and MacOS. Refer to https://docs.docker.com/install/, the official Docker link, click on your choice of platform, and follow the instructions to install and configure the latest version of Docker CE on your system.
Confirm the installed Docker CE version by running
docker --version command.
- Use a Dockerfile https://github.com/yogeshraheja/helloworld/blob/master/Dockerfile and create an image using
docker buildcommand. This newly created image is an image for Hello World application. Create a container by exposing the port outside using
docker run -d -p 3000:3000 <image-name>. Once done, check and confirm the webserver outputs either using
curlor using your public IP with port
3000from the web browser.
- Login to your AWS account using your credentials and select
ECS servicefrom the services tab. There you will find options to Create Amazon ECS Cluster and Amazon ECR repository. At this point, click on
Repositoryand create your first ECR repository. The screen will also display some of the commands that you can use to perform an operation on ECR. Similarly, click on the
Clustertab followed by
create clusteron the ECS screen. From here, select your choice of cluster for Windows or Linux or Network only, click 'next step', and fill in the details of your choice. These details include cluster name, provisioning model, EC2 instance type, number of instance, and so on. To complete the process, click
Create. Once a few minutes have passed, your ECS cluster will be ready to use. In this chapter, we have demonstrated this using CloudFormation. If you are interested in setting up an ECS cluster using the same process, feel free to follow the steps provided in the chapter in Creating an ECS cluster section.