 Hi there. Welcome to this course on running your Docker application with AWS cloud. My name is Prangil and I'm your instructor for this class. Firstly, we're going to create our web application with the help of Python. And once we have our Python web application ready, we're going to characterize our application with the help of Docker and Docker file. And once we have built our Docker image, then we're going to push our Docker image into ECR, the elastic container registry. It is just like a Docker hub, where you can store your Docker images up there so that you can access them from anywhere. Then we will learn about ECS, elastic container services, through which you will be able to provision and manage your containers on AWS cloud. And it has two different launch type. One is AWS Fargate, which is totally serverless solution for running up your container without managing the infrastructure. And the other launch type is running the ECS cluster with EC2, where you will get the option to fully manage the infrastructure. Meanwhile, we will also learn that how you can create the ECS cluster, creating your task, then running up your task and the services, and much more. That's all. If you're curious to learn more about the containerization services of AWS, then enroll this course right now. See you in the kitchen. Hi, welcome back, friend. Now you're already familiar with what is Docker. And before heading towards the actual deployment of Docker images and all other concepts, let us first discuss the various stats that clearly signifies the increasing demand for Docker among professionals, and why you should learn Docker. As you can see here, Docker is most wanted technology in the IT sector, and professors are showing a high interest in Docker over time. These stats are taken from stego flow survey, which is actually a kind of annual developer survey, where developers shows their interest, whatever technology they are using or whatever they want to be in future. And here, the next step here, Docker is chosen as the second most loved platform on the internet. And you can see here that Docker is gaining the popularity and the love over time. And it is above the Kubernetes, AWS, even Mac OS, which simply signifies the growing demand for this Docker technology. Now, here I'm going to present some more graphs and figure which is taken from Docker.com over three years. And here in all the figures, I found something interesting, which is that there is always an upward trend is there, whether we're talking about total number of pools in the Docker hub, or to installation or Docker desktop, or whether I'm talking about number of users and the repositories in Docker hub, all are increasing over time. This simply signifies the demand of Docker, and companies are adopting this technology, the Docker technology, and looking after the Docker professionals. This simply means that Docker is a hot topic in the ID sector. And if you have a scale on Docker, then it will be very helpful for your career path, either you are building a new carrier, or want to switch between the companies, Docker is very crucial technology, and it will help you a lot. This is the timeline of technology, the evolution of technologies, where it started from 1950, the first commercial computer. And then there is made from computer in 1960s, then there is desktop computer in 1970, there is a difference between the 10 to 20 years between them. But after internet mass adoption, after 2000, the technologies evolution, the period between them, the gap between them is decreased, like on 2003 AWS launched then over two years until virtual technology has released, then AMD, then KVM, LXC and Hyper V. These are virtual virtualization technologies were introduced in the technology world. And virtual machine has a great advantage, like it gives a isolated environment with the high security. But but but when we compare it with Docker like container technology, they are somehow lagging behind the like, doctors are lightweight, they can boot fast, as well as they are portable and can easily scale. And in upcoming years, the Docker will be at the peak, the demand is increasing. And after Docker 2015, Kubernetes released, and then to 2016, Windows container released. So the time between them is also reduced. And this is a huge shift from the 1950s to 2016, the world is changing and they're adopting a new technologies. And Docker like container technologies are the new one. And it's going to be evolved over the time. And the best thing is that till now, Docker is eight year old, even it is not have experience of one decade as well. And it is growing massively. So it will going to be rise. And if you have a skill on this Docker, it will be very, very helpful. Okay, now let us compare with Docker with other containers technology, like there is container D, Windows container, RKT and part man. Among them, Windows container and part man are having some weightage over container D and RKT. But when you compare this Docker with other alternatives, you will find that they are negligible. If you're going to compare with Docker, Docker has a huge popularity. And everyone using this Docker, and I've shown the stats that there is a massive activity in the Docker Hub as well. So now I think that now you don't have a confusion like, why should I learn Docker? I will recommend that you having a skill on Docker will be very, very helpful for you. All the best for the future and see you in the class. Hey there, and welcome back. In this lesson, we're going to learn that how this Docker run command work. Just like printing Hello World program in any of the program language, we're going to use this Hello World image. So what happened when we written on this command, it looked for that particular image in our local registry. But when it doesn't get there, it just pulled that particular image from the Docker Hub and executed the container for it. So what happened? This is a Docker client, where we rated down some kind of commands there, then it used with the help of APIs, it communicates with the Docker server, or you can say Docker daemon, then Docker daemon started all the process, all the container related process, right, pulling up the Docker image, then creating the container from that particular image, and so on things. Now I'm going to create another container. And you can say it as a interactive batch session. Okay, so what are we going to do here? It again search for the Ubuntu image, but it didn't get there. So it pulled that image from the Docker Hub. And as I said, that it is an interactive batch session. So we are inside that Ubuntu container. And once we are going to exit from this interactive session, then this container will automatically will be exited. And this is how this interactive session works. Okay, now let me run some of the basic commands. And this is the whole structure, the file structure of Ubuntu container. Now let us use some of the commands. And here I'm going to list the images which are right there in my local registry. So check it out, you can use this Docker images command. And here you will get the list of all the images which are there in our local registry. Now to check the containers which are there, just write down Docker container space LS. Okay, remove this. And yeah, and here you can see that only one container is running right now that hello world one is is exited after performing the task. Now this Ubuntu will be going to be exited. Once we are going to exit from this interactive session, let me show you out. I have to exit from this interactive session, let me open those next terminal, and then check it out. Now you can see the containers, both the container having the same status, they are exited with the status zero. So this is how the whole scenario look like. Okay, and we're going to learn more about Docker related commands. Let me show you that how many commands are there in the Docker. Just you need to write this Docker in your terminal, and you will get the bunches of the commands options, commands like build, compose, config, these are very, very useful commands and are all related to the management commands. And the command section where we have attach, build, create and managing the containers debugging the containers, process related commands, and many, many other commands are there, we're going to learn each of them. Now let us focus on that how you can log in into your registry. So for it, you need to use the Docker login command. But before it, I must log out from this session as I have already logged in into it. Now let me show you that how this process look like. Just you need to write Docker space login, then it will ask for the username, write down your Docker hub username and the password, which is will be not visible. Okay, now it will going to save all your credentials into your config file. And the location is also there. So this is how you can easily log into your registry using the command line. So hope you are interested in this upcoming lessons. See you in the next class. Hi, I'm welcome back friend in this lesson, I will show you that how you can start interactive batch session using Docker on command. So simply write down Docker run, and then you need to provide the name of your container name, which is open to bash here, then write half an it which is used together in order to allocate tty for your container processes, then you need to provide the name of your Docker image, which is open to latest here, and at last bash, voila, we are now inside this open to container. Let us check that our container is running and not the current status of our container. Just simply write down Docker container space LS LS simply means list, okay, and here we find that our container is running right now. And it will work till that we exit from that interactive session. Okay, now I think it is the best time to execute this Docker exec command, which is used to run a command inside the running container. And here I'm going to create a simple test file for it, you need to provide the name of your container and you need to write down the command which you want to run inside that container. And here we tried to create a test file. Now let us check that the command which we run from the outside container it will find or not. And here you can see the test file is created from outside. This is how this Docker is a command work. Hey, friend, welcome back. Here in this lesson, we're going to create a simple Python web application using flask. And here I'm using Python IDE. And I will suggest using this ID because it makes your work much easier. And you will get bunch of options within the same window. Now you are inside this virtual environment. And now I'm going to check it out that any kind of libraries and packages are installed into this version moment. And you will get nothing. So this is how I have isolate my project with other project using this virtual environment here. Okay, now I'm going to install this flask library which has required for now, and we're going to add some more libraries later on. Okay, now you will find like there are a list of libraries and packages are there which are much related to flask. And now, first and foremost, we need to import flask package. Just write down from flask import flask. Now let's create an application instance for our flask app. And here I'm going to give it a app name here. I'm going to pass some spatial variable of Python, which is name here. Okay, now we need to add some decorator into it. This decorator thing is very useful as it will going to convert your simple Python function into flask view function, which means like, whatever the value it will going to return from this hello world function, it will become the HTTP response. So whenever we're going to hit this URL, our base URL of the web application, it will going to simply retrieve this string which I'm going to pass here inside this hello world function, keep learning and keep moving ahead. It's not a simple string, it's the slogan which I generally use and apply into my daily life. Okay, now we're going to run this application for it, you need to mention app dot run. And inside it, you need to pass the things like ports, host name or any other thing like debug. Okay, so here I'm just going to put this debug equal to true. So whenever I'm going to run this application, we will get whatever things going behind the scene. Okay, now I'm going to add ports as well. And you can give any port number. Okay, and here I'm using simply 5001. Okay, now our code is completed. Now let's run this application here. Okay, now we have run our application and you can see that our string which we've passed through this hello world is displaying here in our web page, just because of HTTP response. Okay, now this is my local host. And with the port number, which is 5001, which we passed using this app dot run. Okay, now I'm going to stop this application. And so this is how you can create a simple Python application using flask. Hey, friend, welcome back. Here in this lesson, we're going to cover what Docker file looked like and how you can write your own Docker file. In my previous lesson, we went through the process of deploying simple Python web application. Now in this part, we're going to simply look after this Docker file. For it, we require the base image. And here base image is Python. This is the official Docker website. And here you will get bunches of different kind of tags there, which you can use. Okay, I'm going to use this mid one. Okay, 3.9.5 buster. Okay, now let's create the Docker file. Docker file is simply build instructions to build the Docker image. Okay, now the first part is from command, which tells us what kind of image to base this off. And it is a multi layer approach which makes Docker so efficient and powerful. In this instance, we're going to use this Python Docker image, which again, reference the another Docker file to automate the build process. Okay, now let me mention that what this we're going to do here index comment section. Now the other most important part is add our project file into it. Okay, for it, we're going to use the add command here. Okay, so let me write down the comment section here. Import code. Okay, so whatever I'm writing inside this comment, it will be useful when you're going to download this Docker file. Okay, now simply write add space dot, which means your current directory and slash and your code. Okay, so it will not going to create a code directory inside your Docker container, okay, your Docker image, okay. Now, I'm going to change my directory and go inside this code directory. And now require to install all kinds of libraries and packages, so that we are able to run our applications. Okay, as we know, this Docker makes your deployment much easier, and you can run it anywhere. So we are creating the Docker image through which a container will going to run. So whatever your app which is inside your Docker image, whatever the packages and libraries which were required for that application, you need to put down there. Okay, now I'm going to simply expose the port which is here, which is 5001. And now I'm going to simply run our the main Python function, the main Python driver file, which is that main dot pi. And here I'm going to simply use this cmd, which is stands for command. And if we're going to run this Python main dot pi. So this is my Docker file look like. And now I'm going to build our first Docker image, make sure that Docker diamond is running. If it is not running, then it will not able to pull this base image and we will get some kind of error there. Okay, now the command which I'm going to use here is Docker build command. And here I'm going to put down hyphen t which simply means tag or through which you are just naming your Docker image. And we're going to call it as a flash tab here. And the path where your Docker file is, which is the kind that is simply put down that dot. Now it started all the process which is here to extract the base image from the Docker official website into our local registry. Okay, so whenever we're going to use this Python base image, we're not required to again, pull this up from the Docker hub. Okay, now our Docker image is ready. Let me check it out using this Docker image command. And here you will get the list that how many Docker images are there inside your system. It's always a good practice to use git and GitHub as a developer. And it is very helpful when you're working with a team. And they are located at different locations so that you can share your code and then build your application and also get and GitHub very useful to maintain the version of the project as well. Now here I'm going to create a simple GitHub repository. And here there's nothing. So now I'm going to copy this URL and open my git bash here. I've already logged into it. So there's no need to log into this terminal. Now to any slides you're implicated repository just use this git init command. Now to check the current status just use this git status command, you will get all the files inside your current directory are all untracked. Now here there are some of the files and directories which I don't want to push into the GitHub repository. So I'm going to create the dot git ignore file. This is a file where you can keep all the files and directories details, which you don't want to push it to the GitHub. Okay, so here this one directory that I don't want to push into my GitHub. And I'm going to copy it here. And yes, it's very easy to do so. Now let's check it out that for the current status and you will find that dot idea directory which we're showing earlier is not there. Okay. And now I'm going to make all the files to tracked one you need to use this git add command. Okay, let's write down git space add space dot, which simply means all the files in that current directory will going to be added. Now you will find that all the files are now tracked one. And now it's time to comment there so that our local repository will let it know that what are the files and what are the codes which are inside that files and maintain the version. And here we successfully maintain the first version of our project. Now it's time to push our code into the GitHub. And I have already shown you that the remote URL of our GitHub repository. Okay, now I'm going to use the git remote command to add that remote repository URL. Okay, so let me check it out that any other remote URLs attached to this or not as you can find there's nothing. So here you can clearly copy this and just write git remote add origin and that URL which you have copied from there. So now after it it will going to add this remote URL. Now you can use it for or you can use it for push. Now the last step is to push into the GitHub repository just write down git push origin master. As you can find here that it is set to the master branch. So that's into the end on the master branch. So all the files will going to be added into this master branch. But what happened here that the GitHub repository when I have created it already have a branch name with main. So we don't require this main branch right now. So it's better to delete this branch. Let me show you that how you can delete one. So in the setting option, you will get the option to change your default branch to the master branch. And then at last we're going to delete this main branch. And yes, all the files, all the projected source codes are pushed to this GitHub repository. So you can free to use this code anywhere where you want. And it will be very helpful to practice it. Okay. All right. Now we have learned how to build Docker image using Docker file. Now let us execute this Docker image to create our first Docker container where our application will going to be run. And don't worry about the size of this image. This is an issue and the Docker team is working on it. And we are using Python Buster image. Its size is too much is a proxy 20 MB. So leave this apart. Now let us dive into this Docker image. And here you will can find the complete history of our Docker image. All the things happened with this image are described here. I think you have noticed or not, but you can see here that the all the process which are happened with this Docker image is it is in the reverse order. Okay. And you can see that that at the top, you will find the command which we written down at the last line of the Docker file. So this is all the steps, all the process which happened with this Docker image. Now let us execute this Docker run command to create the Docker container. Just simply write Docker run hyphen it and hyphen P P parameter just to map your host port 5001 to the container port of 5001. Okay. And you need to provide the name of your Docker image which is flask app here, just copy it down and hit the enter button. So now our application is running inside the Docker container. Let's check it out using this URL. And you find that this space is not working right now. And you know that what happened here. Let me explain to you that problem which we face here that firstly we built a local host interface, but we should bind it with the zero dot zero dot zero dot zero host so that we can access our container from outside for just because of different Linux kernel, Docker container kernel and our PC container are totally different. That's why we are unable to use that same local host interface to access the Docker container application. So it's not going to work if you're going to think that same local host will work here but not. So here to interact with that in container, you need to use the bridge communication bridge network here. And if you're going to log in into directly into this Docker container, you will find it just you need to execute this IP address. Come on to get the complete information related to your IP networks of that container. Now I've already checked it out before. So now I simply written on this zero dot zero dot zero dot host name, either you can write that broadcast IP there, but it's okay to use this one. Okay, so our application is now running. Now I'm going to run this command again. And you can see here, there's new IPs here, that IP which I'm talking about. And it will not going to open our application which is running inside that Docker container. So is it cool? Is it so we have executed the Docker container and also check that our application inside the Docker container is running and not and it work fine. So in the later part of series, we were going to dive into more in this Docker thing. Hi, and welcome back friend. Now in this lesson, we are going to push our Docker images into Docker hub. So let me build the image again, as I have deleted that image. So to build your image is to simply execute this command, Docker build hyphen t and the name of your image and the location where your Docker file is. So it will take one minute to create image. Okay, now we have Docker image. We show you and it is flask app here. And now you need to log in into the Docker hub using this Docker login command as all the credentials were saved. So it login it easily. Now you need to push your image to the Docker hub. So here I'm going to use this Docker push command. But before it, we need to create a public repository in the Docker hub. Docker hub is a repository cloud based repository which stores different kinds of images just like a GitHub GitHub stores source code. And in this case, we can download or publish our container image there. And you can have the plugins as well. These are some Docker related repositories. Okay, and I'm going to create a new repository here. I have already published some of them. Now to create a repository, you need to provide a name. And there are two options there. One is public repository or private repository. I will choose this public repository so that it can be accessible by anyone, whereas the private repository can be accessible by concern team or to whom you want to share. Okay, our public repository on Docker hub is created. Now I'm going to use this PSR with three slash flask app. This PSR with three is my Docker hub username. So the first thing which I need to do here is to tag my local image using this Docker tag command. Just use the name of your image, which is flask app. And with the name of this srv slash flask app. Okay, now let's paste it here. And now we have successfully tagged our local Docker image with that image. Okay, now I'm going to push that image to the Docker hub. And it will take hardly two to three minutes. Let me fast up the process. And this will be able to push up our Docker image to the Docker hub. Now let me refresh this page. Then you will find that in the tags and the scan section, the latest tag is there. And we just pulled our image within a few seconds ago. Okay, now I'm going to show you some of the things like how you can pull this Docker hub image and how to make use of it. Okay. Now this is the public view of my Docker hub repository. I'm going to use this Docker run hyphen it hyphen b five thousand one not five thousand one the ports. And you need to give the name of that image, which is psrv three slash flask app. Okay, now just paste it here and run it. So it all things started. Let me show you you the container section and open in the browser. So it worked fine. Okay, now I'm going to delete all the images. You may think that I've already have the image that this thing saved on local. So it's better to delete that one and again run this command. Okay, these are the logs of this running container. Yeah, remove that container right now. And now I'm going to delete all the images which are there are this both images. So you need to use this item I come on, and you need to provide both the name of your images, and just delete it as well as untapped. Okay, now we don't have any kind of images in our system. So now it's time to run that command, talk or run one. So you can see there is nothing is there. But I have logging into my Docker Hub desktop. And here you can see that in the remote repository tab, my flask app is there. Okay, either you can pull the image from there, or you can simply use this Docker pull command to pull that image. Now let me show you some more things. And here you can see that it is back to this, our online repository, here you can find the images layer, there are multiple images layer, and each layer have a their role, like installing something, then adding the files, and so on things. Okay, now I'm going to use that Docker pull command to pull this image, okay, this command, and open your command prompt, and just see there is no images there right now, need to use this Docker pull command. And if we're going to download everything, and it pulled the thing, okay, now I'm going to run this Docker run, then again, hyphen it, be for the ports. And this PSI with three flask app, the end, but we're going to run this container again, just taken from this Docker dot IO, which simply means that it pulled the images from the Docker Hub. Okay, so don't be confused. Now we have pulled images from the Docker Hub, and it is now running on our local system. So this application is working fine, it means that whatever image we created using Docker file, and it is now posted to the Docker Hub is working fine. Now you can share the link of this repository so that anybody can use this application. Hey, friend, welcome back. So before getting started with easier the elastic container registry, here we are going to create the Docker image. Okay, you can find a main dot P wire where I have just created a simple flask application, which we're going to show this spatial message, keep learning and keep going ahead. Okay, well, here I have used only one library which is class which is used for creating the web development things. Now our task is to create the Docker image. Okay, so let me show you that before creating the Docker image that we don't have any Docker image right now in my system, even there are no container is running as well. So keep one point on your mind like when you're creating that Docker image, the Docker engine must be running more. Okay, now let me show you the Docker file, how it looks like. Okay. And here I want to use this Docker build command to build the Docker image. So it has started the process. Now, let's dive into this Docker file. Here you will require the Python, the base file, then I created a directory, then we moved that towards that directory. And then we simply install the required library, which is flask here. And at last I've exposed my port which is five thousand one, which my application will go into response on it. And at last we just simply run the main driver function for this application. So as you can see on my screen, that as I have clear all the cache before creating this Docker image, that's why it's taking too much time because it is downloading this Python base image from the Docker Hub. Okay, so actually this elastic container just to is just an alternative for Docker Hub, where we're going to store this Docker image. And then we can run this Docker image from anywhere. And the best part is that it is totally platform independent and lightweight as well. So we have ended with the process, you can see all the things are set up right now. Now let me hear the screen and see that our Docker image is ready or not describe Docker images and you will find our Docker image is ready right now till till now we don't have container running. So now I'm going to run this Docker image actually this container contains the Docker image. Okay. So just going to write darker space run space it which means for interactive and then you need to give the port for your application for your container and the port for your local from through which you're going to give the request and the name of your Docker image. So it is started. Now we got some matter here. The space is not working right now. Let me check that quite is not working as you can see here. If you're going to run this application on the local host machine, then you don't require the host IP. But when you are going to run your application through this Docker image, which later on we're going to create the Docker container, it requires the IP. So the IP which you need to use here is the 0.0.0.0. Okay. And that's all. Now let us run this application through this URL. And where it is. Yes, that is working fine. Now this is the URL, even you can write local host as well to access your application. Okay. So this is how you can simply create the Docker image locally, and then run that Docker image into the form of Docker container. Okay. Hope you have understand about that a bit how you can simply deploy this Docker things. So in the next part, we're going to jump into ECR section. So for now, keep learning, keep exploring and stay motivated. Hey, friend, welcome back. In my previous lesson, I have shown you that how you can simply create the Docker image. And here in this lesson, you're going to learn that how you're going to push that Docker image into this ECR. So from here, you can create the repository. The ECR repository, you will get some options like private and public. Then then you will get some options like that to add some name to that repository. So here I'm going to just put this my flask app here. And here you can also upload any logo for your repository can add some descriptions. And also you can choose that on which kind of platform your image will going to work. So I'm going to select all of the platforms like Linux and Windows and the architecture as well. And here you can give your information under this about section then the uses where you can use this particular image. So here, our repository is created. And now you need to push the Docker image here, because we don't have an image right there. Okay, now let me give us some points for this ECR that what exactly this ECR is. So it is a fully managed Docker container registry. It is just like a Docker hub, your redhead QA, where you're going to store and manage your Docker container image, even you can deploy them. Okay, so this is here can be easily integrated with the easiest, the elastic container services, as well as EKS, the elastic community services. This is just simplifying the process. It is just simplifying the development, production, various other steps. Okay, it is just simplifying it. So here, now I'm going to use this set of commands to push my Docker image, which I created in my previous lesson to up there do this ECR repository. So first of all, the very first step is to log in. And I've already copied that particular piece of code. And you can see here that we have successfully logged in. Okay, now we need to build the Docker image, which I have already built. Okay, once again, I'm going to do the same task. Okay. So it is again doing the same thing which we did earlier. Okay, now the first step is to tag your Docker image. Now we're going to give the name to this newly created Docker image. Okay, so we did this. Now, I'm going to, you can see here, the Docker image, we got a new Docker image with this tag. And this tag is closely related to our ECR repository. You can see the name is exactly similar to our ECR repository. Now we need to push our Docker image to ECR. So we need to copy that particular command. As you can see that there is no images in our repository. But after running that command, it will going to push this Docker image to ECR. So while it is doing its stuff, let us discuss some of the points related to this Docker hub and ECR. So both of them have this feature of public repository as well as private repository. And this ECR supports MFA for pushing and pulling your image, whereas this Docker hub doesn't have this kind of feature. Second thing is ECR has 99.9% of SLA availability. Okay, where this Docker hub doesn't have that level. Then you can create the immutable images using ECR. But there is no support for these immutable images in Docker hub. Image scanning is at root of this ECR. While you are pushing your things up there, it is actually doing the scanning things as well. But it is there into Docker hub as well. But for it, you will require the paid plans. Okay, as we know, this public repository in Docker hub is free of cost. And you can also create one private repository on Docker hub, which is free. But to create some more private repository, you need to be charged and image scanning will be charged. Okay, so a lot of things are missing in the Docker hub, which we have in this Amazon ECR. So well, these are some of the key differences between ECR and the Docker hub. And now you can see that our Docker images is also uploaded, also push to this ECR repository. And here you've got some of the image details, like its image tag, the image URI, the repository name, and the manifest file, something. So and also it's showing the size of our image, which is 344 MB. You can choose the Python base image accordingly to reuse the size. Okay, I just use the default one. Now from here, you can public your registry from here. And as it is, as it is a public repository, you can view your repository into this Amazon ECR public gallery. Now let us check that our repository is here or not. Okay, so there are a lot of repositories are already present. Let us check it out that our repository is there or not in this gallery, this public gallery. Okay. So you can find that our repository is there. And this is our image. Okay. So now anyone who has the link for this particular thing, and we're going to pull this particular image through this URL, public dot ECR dot AWS, that the ID and then name of our Docker image, and the tag which is latest here. So you can get some of the informations there. Now I'm going to change the name the display team, which is showing there to the new name, a custom name, okay, either you can put your name in the display name section, or do if you want to be anonymous, okay, you don't want to show your name, you can simply write any random name and nickname. So here I have used this AWS user account, which is set for my account AWS account. So now you can see that there is default alias, which is have some particular exodus is there. Okay. And custom alias is the name which we put down there. Now when I'm going to refresh this, you can see the name is now changed, just by AWS, they're waiting 21. And the ID, which is there will be remain, you can see public dot ECR dot AWS dash and that particular thing is there. So from here, you can if you want to do some any changes there, if you're also going to reflect there into that particular gallery, hope you understand about this ECR. Now keep learning, keep exploring and stay motivated. So let's get down to the business. In the previous lesson, I've shown you to how you can create the public deposit free. Now in this part, we're going to create the private deposit right here. Okay, so as you can see, we got some numbers up there in the URL, some 10 digits number, I think. So basically, it is the ID for this deposit to name, okay, to uniquely identify this private deposit free. Okay, so we have successfully created the private deposit free. And here we don't have any Docker image right now. So now we need to follow the first step, which is to retrieve an authentication token and then authenticate our Docker client to the registry. So I have copied that chunk of code here. And now we have successfully login to our registry as well. So now we need to build the Docker image again. It is not required because we already have the Docker image. Now we need to use this tag command, the Docker tag command to give the tag to this image. Okay. So if I'm going to run this Docker image command, you will get this public dot easier dot aws one. And then we have another Docker image for the private deposit free. Okay, now we have done, we need to only push this Docker image to private deposit of ECR. Okay, through this Amazon ECR, we can have as much as private deposit free, we don't have any limitations there. But in case if you're using Docker hub, then you will got only one private deposit free. Okay, so if you want to create some more private deposit free up there, you need to pay some charges. Okay, whereas in ECR, you can create as much as the private deposit free. Now, as you can see, now we have successfully pushed our Docker image into this private deposit free. Now we have the same Docker image on private as well as public deposit free. And here you can see different options, different details of this particular image. Now, let us explore some of the other options, which are there, like I'm going to scan this particular image. Okay, and let us check the report about this Docker image. Okay, so until then we can be going to explore some of the points like life cycle policies, like if you want to remove your unused images, then at what time it will going to be removed. Okay, so you can set different life cycle policies up there. Then here we got some vulnerabilities. Not some actually it is 502 vulnerabilities. Okay, so don't worry, it's just a sample Docker image, which I created. It doesn't mean that it doesn't have any kind of vulnerabilities. So these are, this is the benefit of using this Docker, sorry, this Amazon ECR through which you can do some image scanning. And here you will got some bunches of informations like there is only one critical vulnerability, then 15 high and rest are like they are vulnerabilities, but they are not too much highly concerned. Okay, so don't be worried. Don't see the number the big number there. So that's all there is that how you can set up this private and public deposit free using this Amazon ECR. If you have any kind of doubt, you can ask me in the Q&A section. So for now, keep learning, keep exploring and stay motivated. Hello, friend, welcome back. In this lesson, you will learn about ECS, elastic container service. It is basically the managed container orchestration, which is posted on AWS through which you can manage your container life cycle, like it includes the provisioning of your container, then deployment of your container, scaling up, scaling down, networking, the load balancing and much more. You can do various job with this container orchestration tool. It is just like a Docker swarm, the Cuban 80s, even open ship, they are basically the container orchestrations. And it is required because once you have multiple containers, it will become quite complex to handle them. So it will go into automate the process and removes the complexity. That's all about container orchestration and the ECS. So let's create our first cluster here. And here you will get three cluster template. One is networking only template, then EC2 Linux plus networking, then EC2 Windows plus networking. Okay, let me discuss each of them. So the very first template, which we have, which is networking only, it is used to create an empty cluster, which is typically used for the container instance, which are hosted either on target or any external instances like ECS Anywhere, which includes the on-premise services as well as on cloud. Okay, so that's another thing. So then we have EC2 Linux plus networking and EC2 Windows plus networking. They both are similar as they're both going to use the EC2 instance here. One is for creating the Linux container and other one is for creating the Windows container. And the rest of the things are the same. Okay, so now here I'm going to select the networking only template as the purpose here is to create the AWS target services, which is a serverless thing. Okay, now you need to configure your cluster, give any name for your cluster. And as said, you can also add the VPC into this template. So I'm going to create a VPC for this cluster. And if you want to add some tags, you can even add some tags into it. So now we will have a ECS cluster. And here we are to create the Fargate services. So Fargate services is a serverless compute for the containers. With the help of this Fargate, you need to only build a container image, then you need to define the memories and the compute resource which is required to run your container image. And then it will go into run and manage your application. So here the best part is you only have to pay for the requested compute resources when it is going to use. Okay, not like if you're going to run with EC2, you need to pay for that particular EC2 instances. But here the picture is different. Here you need to pay only for the requested compute resources. Okay, so that's the best part of using this AWS Fargate. So here we are using our AWS Fargate. And later I'm going to show you as well that how you can create the cluster with the EC2 instance as well. So as you can see that our ECS cluster has been created. And some of the things are left. And it is also completed right now. So we have created the ECS cluster for the AWS Fargate with the help of CloudFormationStack. Okay, so we have a cluster with some VPC and subnets into it and to manage the serverless compute containers. Okay, so in the next part, I'm going to discuss about task and the services as well. And then we're going to deploy our application. Here you will get option for updating your cluster details. And you can also able to delete your cluster from this option. Okay. So that's all. In this for this lesson, as we have created the cluster, the Flask cluster here, okay. So so for now, keep learning, keep exploring and stay motivated. Hey, friend, welcome back. In my previous lesson, I've shown you that how you can create the ECS cluster using the networking only template, okay, for AWS Fargate. So let me revisit some of the points, which are very important here, like this AWS Fargate is a technology that you can use with Amazon ECS to run your container. And here you don't need to manage the EC2 instances. So with AWS Fargate, you don't don't need to actually provision configure or scale the cluster of your EC2 instances to run the application. So it removes the problem of choosing the server type, then deciding that when to scale your cluster and how to optimize the cluster and various other things. Here it will just going to charge like whatever required compute is there. Okay. And it is very easy to set up the AWS Fargate. And here I'm going to show you that how you can create the task here. Okay, so let's get into it. So this is task definition page. And here you can define the task. So basically, we are going to specify the container information for our application, that how many containers are required for this task, how much resource they were going to utilize, how they are linked to each other if you have multiple containers and on which board they were going to respond and various other options. Okay, so let's click on this create new task definition. And here you will get three options. One is Fargate, EC2 and the external which is on premise thing. Okay, now here you need to configure your task and container definition. So either you can create the new task role if it is there already, just select that one. And then you need to give the task definition name here. And then the network mode which is already selected, which is AWS VPC. And you need to choose the education I am role here, which is same as previous one, then you need to select the task size, the memory, the CPU utilization here. Now here, the main thing is to add the container. Okay, so I have already pushed one of my Docker image to Amazon ECR. Okay, it is just like a Docker hub. Okay, where you push your Docker image up there. So you need to give the name of your container. And then you need to specify the image name. Okay, so here I'm using this prior repository, you are okay. And you need to provide the port number through which you can actually do some port mapping to your application. Okay, so this is this is my application basically. And here I have used five not not one port number. Okay, so you need to provide that stuff here. And you can also add some health check, like at what time your container is responding, and then timeouts, then storage and logging. And then resource limit that that resource if you're not going to proceed. And you can even add some Docker labels for your understanding. And that's all. So you can also integrate your service integrations and various other things you can set up here, like volumes as well, if you want to give some extra volume to this container, if it is required, as my application doesn't require that much of thing. So I have not selected that volume thing. And here you can either choose the EBS, the EFS things. Okay. So this is the JSON format for my template for my actually last definition from now, through this action, I can run my this task. Okay, there is an option for update as well. These are some of the options. If you want to lose lose some changes you can do from here. So that's all in my next lesson, I want to show you that how this task will going to work. Hello, friend, welcome back. So before running our task, let us revisit some of the important concepts which I've already discussed about Amazon easiest task. So this task definition is required to run our Docker container in Amazon easiest. And where you can set the Docker image that how much CPU and memory we're going to utilize by our application, then what type of launch we are going to use like far get easy to or on premise things, then you can set up some networking settings there, the logins, the volumes, and involve variables, as well as I am rules and lots of other things, which we configure into this the task. Okay, so here in this lesson, I'm going to show you how you can run the task. So here you need to select again, this launch type to the far get. And here you need to select the number of the task. Okay, here I'm just going to run only one task here. Then in the network settings, you need to select all the default options. Now, all the things is done now. Now let us tap this run task button. And yes, as you can see that under this task tab, our task is now provisioning and the desired state is the running state. So it will take a quite time. And once it will ready, then you can easily access your application, the application which is derived by the Docker image, which we're going to create the Docker container. And that's how you are actually interacting with your container. Okay, so in the next part, I'm going to show you that after it will be in the running state, how you can access your application. That's all keep learning you exploring and stay motivated. Hello, friend, welcome back. As you can see on my screen, our task is in running state. And these are some of the details of our task that network here you can have your private IP, the public IP, then an ID as well. Then here you can find the logs of your application here. This simply means that our application is in running state. Okay, our container is in actually in running state. So now our task is to access our application. And to do so, we need to do some of the network configurations. Okay, before it, let me show you some more things about this task. And as you can see, this is the bunches of information about our container. Okay, we didn't configure that much of settings, but still our application is running state. Okay, now this is our public IP. Now I'm going to use this particular public IP to access our application. And our application will going to use this 5001 port number. Okay. So as you can see, the site is now reachable. It simply means that something is still missing. And here we're going to figure it out and to solve this problem and then access our application. So here you will get this network interface ID. And inside this network interface ID, you will get information about your security group. Okay, inside the security group, you will get option about the inbound rule. The inbound rule will going to define that what kind of traffic will going to be accepted by your application, your container. Okay, so now I'm going to enable this port number 5001 here inside this inbound rule. And anywhere I before I'm going to select here, and then going to save these rules. Okay, now we have made some changes here. You can see inside this inbound rules, our custom rule is also added inside this security group, which is attached to that our task. Okay, so now I'm going to, if I'm going to run this particular thing, then we're going to work for us. Okay, let me check one more time that the configuration which we did is still there or not. It is there. Okay, so well, our configuration is has been completed. Now, as you can see, we are able to access our application. So you need to do some things like you need to add the inbound rules to able to access your application. Now, I'm also going to show you that, suppose if you're going to have high traffic, and then how your application will going to respond to that. Okay, so it's better to re-run the task. Means till now we have only one task for our AWS Firegate, but instead of running one task, you can even run some more similar tasks. Okay, so it will going to balance the traffic. Let me show you that how it will going to work. You need to do the same settings, like the default setting, which we did earlier. And our task is now in the provising straight. Now, once it will ready, we need to do the same changes again, like inside this network interface ID, then we need to go that security group. And then we need to change the inbound rules for that particular task as well. Now, let me do the same thing again. So this is the inbound rule, we don't have that one. So your custom TCP, then you need to put your port number through which you are able to access your application, then IP anywhere. Okay, so we have successfully made same changes to our newly created task. Okay. So now let us figure out that our application are going to work with this DAX2 or not. Okay. So I have again verified that particular inbound rules was present or not. Okay. So we got another IP, another URL. And let us open into new tab. And you need to put that number as well, which is 5001. And as you can see, we are able to access our application with two different IPs. Okay, so to shift the traffic. This is all about ECS Fargate, how you can run your container image to deploy your application. So keep learning, keep exploring and stay motivated. All right. Now you are already familiar with container-related keywords like container itself, container orchestration, how this ECS cluster work, order AWS Fargate and various other things. We have already discussed all about it. In this lesson, we are going to create the ECS cluster with the help of EC2 Linux plus networking template. So let me revisit some of the concepts like we have three templates, one is networking only, other one is easy to Linux plus networking and the third one is easy to Windows plus networking. So the first template, which is to create the empty cluster, and we don't require a dedicated infrastructure for it. We are totally focused on the serverless cluster thing. Okay. And now we are creating the ECS cluster, where we have the EC2 instance as well to have a complete control over the infrastructure where we can run the task, our services on that cluster, the cluster which will go into it run inside our Amazon EC2 instance. So if you want to run a service or your task on a serverless infrastructure, then go for AWS Fargate. But if you want to have more control over your infrastructure, so then you need to use this template where we have set up all other things with the EC2 Linux plus networking. Here the only difference between EC2 Linux and the EC2 window is that in EC2 Linux, it will going to create the Linux container. Whereas in the EC2 Windows, it will going to create the Windows container. And that's only major thing, which you need to make sure, okay, that what kind of container you require. Okay. So in both the case, EC2 instance will be going to create. Now this is my CloudFormation stack. If you're already familiar with Azure, then you must be know about the resource group. This is just similar to the resource group, where you can manage multiple resources into one place. Okay. So you can delete all of the resource just by deleting the CloudFormation stack. Okay. So now we have created the EC2 cluster, the help of CloudFormation stack. Now this is our cluster EC2 EC2 cluster. Okay. And the status you can see here, it is active. And there is no services, no tasks running up there. And inside this ECS instance tab, you will get the container instance. So let's check it out. Some of the details of our container instance. Here you will get the name of your cluster, then the EC2 instance ID is also there. Then the operating system is Linux, the ability zone, then the public and the private IPs, and lots of options are available here. Okay. So if you're know about EC2 that it will be quite easy for you because we're going to do some of the changes in the EC2 instance as well so that we can easily access our application, which is running inside the container. Okay. So let me show you about this EC2 container instance. So here it is. So this is our EC2 instance. It is also in running state, you can see as well. Here you can have access about your EC2. It is using this D2.micro one. And the status is not completed fully. As I can see on my screen, it is still in the initializing mode. So once our instance state is ready, we'll be able to connect our EC2 instance. Okay. Now here you will get public private IPs to communicate with this EC2 instance. Now these are some details of the EC2. Now you need to go inside the security group. And here we need to set up some inbound rules. Okay. So that we can access the application. So as you can see, only one inbound rule is set up. So now I'm going to configure actually I'm going to add one more inbound rule. So all TCP and anywhere, okay, then save the rules. So whatever there is no restriction right now, okay, it can accept any kind of protocols. Okay. So in the next lesson, I'm going to show you how you can create a task and the services. So for now, keep learning, keep exploring and stay motivated. Hey, friend, welcome back. In my previous lesson, I've shown you that how you can create the cluster, the easiest cluster with EC2. Now in this part, we're going to define the task. So give any name for your task here, then here you will require these EC2 capabilities. Then you just like the task rule, then network mode. And here I'm going to select the default one. Now here you need to select the IAM rule, the task size, you can put any number here according to the requirement. Okay. So here you need to give the specific number 10, I think one GB will be sufficient or 512. Okay. I'm going to give 512 value on both of them. From here, you can set up some volumes and various other options. You can add something. Now here, you need to also define the container. Okay. And here you need to set up the Docker image through which a container will going to run. Okay. So this is the my container, the Docker image, which I have stored up there into ECR. Okay. Now here it will also require some other things here like that on which particular port you want to expose your container and through which port you can access the particular application which is running inside your container. So this is my application where I have used the port number is 5001. Okay. So here I'm going to use this particular number here 5001. And again, you can give any number 8080 as well. 8080 and 8080 and the 5001. Okay. So these are some of the port mapping which I'm doing here for the host port and the container port. Now here you can add some more storage, security, labels, resource limits. And I don't think so that anything is required for my application here. Okay. So here we've got some error like host port must be unique across all containers. Okay. Okay. So I'm going to remove some of them from here, because it is giving an error here. So I think this 5001 and 5001 would be okay here. Now I've added a container. Okay. You can also add even health check also. Now the thing is 8080 and 5001. Okay. This is the thing which I have did here. And now our task description is created. Then the next part I'm going to show you there how you can run your task and how you can access your application. Now the options I've left because I don't require right now, but you can use if you're already familiar with Docker and Docker related things. That's all. Keep learning. So now I'm going to run our task here. Okay. So here you can see that there are some of the task definition, which I have already declared them. So this is the task definition, which we configure in my previous lesson. And here we got some options like action through which you can run your task, you will create a service from that task definition, and so on things easier services. I'm going to discuss all about it in the next lesson, which is to run your container for longer period of time. And like you want to run some of your container all the time as well, which we can do with the easier services. Now we have run the easiest task here. As you can see it is in the pending state. And once it will change into the running state, which is the desired one here, then we will be able to access the running container and the running application inside the container. So while you are going to create a service, eventually we're going to create the task. Okay. And it will be a self feeling task, like whatever happens to this task, any error comes into it. And, and it failed, then we're going to run a new task and that particular task, the field task. Okay. So, so our task is now running, which simply indicates that our application will also be running in state. So here you will get some of the options. And let me open each of them into the new tabs. You can see here, you got some public IP in the private IP as well. So let us use this public IP to access our application. You can see here that we are able to access our application. This happens because we have already set up the inbound settings. Okay. That's why we don't we don't got any errors here and it open this one shot. So here you will have public IPs, private IPs, the state as you can see from here, the running task, which is one here. And the source is the memory and the port, which it is utilizing it, you can see all of the things up there. And that's all. This is how you can create a task and access your application. In case you want to update your task, you can also do this. And in case you if you want to run such tasks, you can also have that option also available here. So it's very easy to run your containerized application up there into AWS containerization options like ECS Fargate and ECS EC2 version. Okay. So we got lots of options there. And that's all. So if you have any kind of dog, you can ask me in the CUNY section. So for now, keep learning, keep exploring and keep moving ahead. All right. Now in this part, I'm going to talk about ECS services. So before jumping into it, I'm going to discuss some of the important things related to ECS services and ECS task. So you might be confused with these two terms, because ECS task and ECS services, they are going to do the same thing. But the major difference between them is that ECS task is used for short term task for short term goals. And various ECS services is to do when you want to run something for a longer period of time. In my previous lesson, I've already shown you that how you can create the ECS task and how you can run a container with the help of ECS task. We actually define the task with the help of task definition, where we configure some of the settings related to containers, like which document you are going to use it, on which port you are going to expose it, and then CPU and memory utilization. Then you have learned about the environment variables, the volumes and various other steps we have seen up there while defining the task. Now here, let me summarize you something like in simple words, a running a task is like launching a container, okay, which we're going to stop after some times because it is for the short term. But when you're talking about ECS services, which will guarantee you that some of the number will going to run all the time through which it gives a feature of high availability and the self feeling things like suppose one of your container stop just because of so and so errors, and you want that particular container to be run all the time, then you need to refine the ECS services, like that container we're going to stop due to any error come up, and it will going to run again. Okay, actually, we're going to create a new instance for it. So this is the major difference between ECS task and the ECS services. So here, now I'm going to create our ECS services. Here, all the things will be seen like the configurations which we did earlier, all the things will remain same here. So let's get into it. Now, this is the dashboard. Now here you just select, you need to actually configure your service. So first of all, you need to give the name of your service. And then the long time which we have already selected then the number of tasks, I'm just going to put the one number here that at any point of view, that particular container must be running. Okay, that particular one container must be running all the times. Now here you can put the load balancing settings as well here. I'm just going to give it a none here. Okay, and then there will be option for auto scaling as well, you can see it is also optional. So I'm also going to set to do not do auto scaling here. Okay, so that if I'm going to able and enable this feature, it will going to charge as I'm using the free tier one and it doesn't allow me to use this feature right now, like auto load balancing, which will going to balance the load between different containers or auto scaling is like when the high load is there or then if you're going to scale that particular task, that particular services, the number of containers will going to be rise. Okay, so these are some of the things which are here, which you can do while creating the services. Now in this, you can see that our service as we can create it. And this is the it is in running state, as you can see here. So service created a one running task. Okay, and here you can see that there are two ports are available here. And you can see that it is accessing our application. So I have used the task definition which I have defined earlier through which I have created the services. And that services has created the task only one task. Okay, now this is our easy to instance, you can see the instance is running right now. And there is a lot of options you can see here, like public IP, private IP, running tasks is called one, then the different options are there, you can see that required CPU and I've lived with CPU right now, the memory, the ports, and various other things you can see here. Okay, from here, you can also update your agent, as well as you can de register this particular services from easy to instance. Okay. So this is my cluster. This is my container instances. And this is the running service. Now from here, you can also update the configurations of your services. Okay. So I don't want to do any update here, but you can see that there is placement tamper is also there. Okay, how you can it will going to create a new instance once any container failed you do some error. Okay, this is a type of replica. Okay, and replica set and QNAT or any other container orchestration, it will going to maintain the number of replicas that the same way this services is doing the job here. Okay, and now I'm going to delete this particular services from here. We need to just write delete me and yep, our service is deleted through which a task which has been created with the help of services will also going to be deleted. And various other things we're going to happen. So this is how you can create the easy to sorry, easiest services and how it will going to run your container your application. Okay, that's all so far now keep learning give exploring and keep moving