Deploy a Machine Learning Streamlit App Using Docker Containers | 2024 Tutorial | Step-by-Step Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone I'm Saran in this video Let's Learn how we can deploy a machine learning based streamlet app as a Docker container so for this deployment I will be using the multiple disas prediction system app that we have already created that has diabetes prediction artisis prediction and Parkinson's prediction model deployed as a streamlet app where the user can give some values and based on that the model will predict whether a person has a particular disease or not so this is what we will be discussing today and before getting into the video some of you may think that Docker and Docker containers are a pretty complex subjects and deploying that would be a very you know difficult task but actually it's a very simple process and let's try to understand how we can do this in a step by-step manner so before getting into the coding aspects and the deployment process let's try to understand what are all the different factors and steps that we need to follow for this the first step is obviously building a streamlit app where we have our machine learning model or some data analysis uh you know app deployed as a streamlit app now we have to do enough testing to make sure that this uh app is working fine and without any bugs and all that right so once we have our streamed app ready with the requirements file and all those things we can move on to deploy this app as a Docker container and the first important uh aspect of deploying this is creating a Docker file so this Docker file is like a recipe of a me so here we list down all the instructions that we need in order to build a Docker image right so you can think about this Docker file as a you know a blueprint for a house that we are going to build and then based on these instructions we build this Docker image so this Docker image you can think about it as uh you know model of the house that we are going to build right and the docker container is the actual house itself so the purpose of this Docker is that let's say that you are working on building an application and someone has to test this application and there are like several process that comes in a software life cycle management right so let's say that you have completed all the development work and now this has to move to the testing phase now the one way to do this is to share all your code and Library details to the person who is going to test it and they probably will kind of run all those scripts in their machine and try to test it and in this proc process there are a lot of things that can go wrong so they may use let's say a different python version and you may use a different python version so it may not be compatible with the libraries that you have installed so this goes for any application that you build not just for python so this is where Docker and and containers helps us to build a standalone package that kind of has all the dependencies that our application needs so that's what we are doing here right and for this container we need to build image which is again like a model for the house that we are building as I said right so here we will uh in the docker file we will mention like this is uh you know the python version that I need and these are the list of commands that should run and this is the python script that should run finally and so on so this may change for a different uh you know front end application or something like that right and based on this we build a Docker image and then we kind of run a Docker container so this Docker container is like a runtime instance of this Docker image so the other analogy for you to understand would be you can think about this Docker file as a recipe for a cake and Docker image as like you know a baked cake or something and Docker container is like a piece of cake that you're actually going to eat right so this is like a simple analogy that you can understand so this is the process we will follow as well the first is we would have a streamlet app code ready with all the requirements file and then we would have a Docker file where we mention that first it need needs to install this python version and it needs to install these set of libraries and it should you know run the stream lit run command and so on and later we will build a Docker image with this Docker file that kind of does all these steps and finally we run this Docker container and now we can access our streamlet app right and the importance of container is that you can kind of build several containers from a single Docker image and all these containers will be isolated so that's the other thing about it so once we do this we can push our Docker image to Docker up so this Docker up is like a public registry where we can save our Docker images so understand about this we are we are not going to save our containers to Docker up but we are going to save this Docker image to dock so dock is just one option so you also have uh you know container Azure container registry in Azure and similarly you have ECR which stands for elastic container registry in AWS and so on so this is what we be doing first is like make sure that our streamed app is working next follow all these procedure in order to build a Docker image and run a Docker container and finally pushing the docker image to the docker app so let's get started and uh so for this development and for this deployment I I would suggest you to try py Cham so that we could uh you know access terminal in a better way and so on because we are going to run several terminal commands and uh regarding the code for this I've created a GitHub reposit for this that has like all the required files and so on so here you have this collab files folders where you know you have the collab files that's needed in order to build your model files that the streamer app is going to use and all those trained models will be St saved in this folder called as saved models right so you have this Sav files you can also save it as pkl pickle files as well so it shouldn't be a problem and then you have this data set that I used in order to train these uh models I'll also you know give you the link of the video where I explained you how you can build the streamlet app and like all the individual aspects of the streamlet app so you can refer that as well so that's about it and I've also made this read me in such a way that uh all the steps are kind of listed down and you can just follow this and you can like deploy this easily so it shouldn't be a big problem right and I would suggest you to have this code uh with you and watch this video and do this like side by side so that you kind of get the angle and going into the code as I said uh this app.py is the code that I have for this stream lit app so if you want to run the streamlit app you just do this streamlit run app.py so that would uh kind of run the streamlit app so you can kind of go through this code and yeah so that's the other thing so if you want to understand like what all these code mean and all that uh I'll give you the video link as I said and now let's uh get started with this deployment so the first step is we need to install the required dependencies or this is to this is need to have these requirements installed and also you need to push this requirements. EXT to your uh you know Docker container so let's do that first step here so for me I've already installed uh all the required libraries maybe I can uh run this again as well so I'll say pip install R requirement. dxt so make sure that you have a proper uh virtual environment and uh yeah so you can have all the files here this to this dollar sign so it says that all the requirements are already uh kind of installed and now can deploy our streamlet tab streamlet uh space is run app.py this will open a web page in our Local Host so here you can give some values and get the predictions out of it is the screen let's just put some random numbers and see if we are getting a prediction out of this let's say the blood pressure Valu is thickness you can just put some random values for now if you want like accurate numbers you can refer to those uh set files not interested in the result you may need to kind of improve the training of the model so that you want to get accurate prediction but we are not focusing on that for now for now we just want to deploy this model right so yeah we won't be doing okay so this step is done so we could that this app is working so you can also test this with this this page and the parking prediction page and so step is we can move on with the other steps which is to build this Docker image and uh yeah the other thing about this is make sure that you are running as administrator if you are using Windows and I'm Linux so I'll just like use sudo commment so that I you know I can run these commments as admin so that's the other thing you need to do so you can run your pyam as administrator and if you're like working on other IDs like spider and you are work on you are like running these commands on your anaconda prompt or your you know command prompt you have to run those as administrators so that's other thing but again as I said I would prefer you to use P Cham so that you could access terminal and the code base like simultaneous that's one thing and then uh you need to install Docker on your system so for Linux you actually don't need Docker desktop which is uh GUI version you can just install a Docker from their like page so you need to run a run a set of commands and install it from uh your terminal and for Windows or Mac right so I'm not sure about Mac uh but for Windows you have Docker disktop so Mac should also have Docker desktop and again it's easy to manage your containers images and so on but I would say that it's better for you to have some uh you know practice in the common line as so that's like a good thing to do so you can install Docker desktop but still run all these comments and command prompt and and learn how you can access things from there and how you can you know run some process from your that's other so first we have installed the require libraries we tested our stream T and now we need to build this and for uh building this first we need to start Docker right so in Linux you can just run this command and in most cases it kind of starts when you are PC kind of start so that's okay if not you can just start it with this command which is uh Pudo system CTL start Docker so for running this you should the home directory so I can close stop this stream for now so this as well clear so if you see I'm currently in the project directory so what I need to do is I need to go to the home directory so I can just do a CD of this so this will take me to the home directory where I can run this Pudo system ct. Docker so this will start my Docker engine and uh in again Windows or Mac if you're working on that right let me just put the password okay so this is my system password now so if you are uh working on Windows you can start the docker engine from Docker desktop as well so the first time you open it so it might take some time for for you to see that option so later you could see that in the bottom left corner when you open the settings and all that so it will show that uh you know the docker engine has started and so on so you can kind of do that and now the next step is again Windows you can uh start the docker engine from the docker desktop now we are going to build this Docker uh image but before that let's try to understand the contents of this Docker file and these are the files and folders that you need in order to run this uh stream lit up so you need this saved uncore models and then you want this app.py config2 ml credentials. 2ml Docker file and this read means it's just step so you don't actually it so what you can do is you can maybe create another folder so I'll do this I'll create a directory and I'll call this as streamlet iph sorry underscore app and maybe I'll move all these things that the docker needs so these are the that we want I'll just cut those things and paste it right so now I have my read me and requirements.txt file alone here so so I need to move this requirements. TX as this stream L up so maybe this is how you can have your uh yeah structure right so so you uh have this project folder where you have this V EnV so I did this because uh if I have have this app.py Docker and so on this it may kind of copy the other files like cre me and even the B and V the virtual environment folder to Docker so we don't want that so I can just say that uh you know I can just like put all these within the stream T and say that I want only the contents of the streamed T folders to be pushed to Docker so that's the purpose of that so that's uh the main thing the stream L app we have app.py and saved models to access the files config ml credential and Docker F now let's understand this the first step is we are going to say that uh this container needs Python 3.10 and this is like the base uh thing that it's going to install so I'm going to say from python 3.10 slim so there are like different versions that you can use you can kind of refer this online as well you will like find several options if you want to deploy this on 3.8 or something can kind of uh include that so this will be the first step so these are like some of the standard St that we do in Docker and then uh we have this and the other thing that I forgot to mention is that the file name should be Docker file where D should be uppercase so you shouldn't change this this is basically a text file but Docker and these IDs kind of recognize this by this name so you can see that it's in the shape of a veale so that's how it kind of recognized that this is a Docker F and it's it's recognizing that from the name of the file and now the next step we are like copying everything in the current directory to the app directory in the container now this app directory is not something that you should have in your local system this is the directory that you would have in your container in your Docker container when it's building right so we need to copy the current contents of this particular folder and uh yeah so I'm going to run this this stre tab so what I'll do is I think this this is okay because what I'll do is I'll navigate to this stream Tab and then I'll run my uh Docker file so what happens is like when it's when it kind of says this dot that means the current working directory so when I access the terminal from the streamlet app when I say dot it means like uh this directory and we are going to copy all the contents of this directory to this app of uh you know uh container so in the container we are creating a app and putting all this contents to it so that is all and then we are changing the working directory to uh app right so the the working directory inside the container can be the users directory and to that from that we we are like kind of navigating to the app directory where or all our files are situated so that's the next thing and the other thing is installing all the required libraries so now we have this requirements.txt this do this okay so now uh the requirements this mve so the in the project directory I just have this read me file so apart from that everything is okay so this run will run this command which is PIP install uh iphr requirements.txt so this runs pip install for all the packages listed in the requirements. file so this runs in your Docker kind or the image when it kind of runs now uh we are kind of exposing a port to it so this is the port where our streamlet app will be deployed so this tells docker to listen on Port 80 at runtime Port 80 is the standard port for HTTP so this is for that purpose now need to move these credentials and config file to uh the directory called a streamlet so this is requ for the streamlet to work it's it's basically contains some configuration details if I open this right so you will see that we have this level debug so in our uh logger of Docker so this will like log all the errors and infos so that we kind of know how to debug it by like looking at that so that's the purpose and then we have like other details as well so you can go through this this is like pretty standard stuff and you can uh kind of add few things to this if you want say for example you would have like a course uh enabled as well so so you have this enable course which is this cross origin resource sharing so if you're working on web app uh web application you should be kind of aware about this this is when you know uh application in one domain if it can access uh the contents of uh you know the other domain so it can happen only when uh the course is enabled but there are some security issues to that so you can I mean just like a pretty simple explanation for that but there is actually yeah more to that and then we have the server address so yeah internet address of the server that the browser should connect to so can be IP address so this is the server where uh the streamlet will be uh deployed and then we map this to this 0 port and so on so this is about this configuration F and now uh we copy this config2 ML and credentials. ml to the streamlit directory so here we are making or creating a directory called as do streamlit in the home directory and to that we are uh this CP is like we are just like copying uh this particular file to the streamlit directory and similarly we are doing this to the credentials. 2 ml files so if you're deploying the streamlet app right so these two steps like pretty much like won't change you can actually use like the same Docker just that you need to update the libraries in your requirements.txt file and just like run other things and now we have the commands to run it so we are saying that entry point is streamed at run so this is just like running uh the streamlet run from our terminal so we just did a streamlet run app.py right so this is kind of similar to it say that streamlit run app.py so the CMD is it's basically like uh in the comment we are telling to run this app.py with streamlet run this is about the docker file so for deploying something on your Docker file this is like a very basic and compulsory thing that you need so you have some application files code files to it and then you have a Docker file that kind of says the list of steps that should happen so when we build this Docker image all these steps will be executed one by one and you can also see this in the progress bar in the terminal and so on so all these steps will be executed once this is done we would have a docker image and later we can kind of create an instance of this Docker image which is nothing but a Docker container right so let's understand how we is this Docker file and let's look at the next step in this read me file so now we need to start this yeah we have already started started Docker as I said if you are on Windows you can start it from Docker desktop if you are Linux make sure that you're working from particular directory is the direct time current okay now uh when you build this Docker right you need to specify the path of this Docker so for that I'm just going to uh move into the streamlet app folder T so now we need to paste this command so let's understand what this command so this Pudo I'm running as admin Docker build so this is where we are going to build our Docker image from the project directory so T is nothing but it's just like tagging it with a name so I'm going to give a name for my uh you know contain sorry not the container but the image so this you can replace it with anything and you just need to put a tag so tag can be latest or it can be like version 1.0 2.0 or something like that and this dot is a very important thing as I said uh in the docker file right so dot means it's like the working directory similarly uh this dot means like when you are in this streamlet up when I say dot this basically looks for the docker file so when I do Docker build uh T image name tag dot so this will look for the docker file if your Docker file is in some other folder you need to give that respective path for Docker to build that image right so I'll copy this Ian it's okay if you have this in the previous structure uh that we had as well along with this V and V and all that it won't affect it but yeah it's better if you have this in a separate folder I just change the image name to something like I just have a short name as multiple d h call this as H let's call this tag as version 1.0 and this dot we are not going to change it because we are in the Stream l which has this Docker file so if you are let's say having another subfolder let's say as main uh now you need to say that do/ main so something like that right so that would kind of access this Docker file let's run this so this is that one step that kind of needs to happen within the project directory so this is building the docker image so if you see here uh the first step is uh kind of getting this Python 3 10 slim which is our first command and then it's running the second command which is copying the contents of the project directory to app directory of Docker image of the docker controller then it's changing the working uh folder working directory to app and now the next step is installing the dependent uh you know libraries so this is happening by pip install iPhone requirements. if you remember these are all the things that we have mentioned in the docker file so we have this from python thing copy to App working directory all the other commands will also run this installing the libraries may take a bit of time to include kind of install all the libraries so I think it installed it yeah all the process has finished and now uh the docker image is built now let's go to the next step before that right you have built an image and now you realize that you have you know some bug in the code and you need to rebuild this you don't have to do things uh from the start you just need to make some changes in the app or something it can be changes can be like uh in any places let's say that you forgot to add a library so what you would do is add this change uh maybe let's say in the requirements.txt file and you just run this Docker build command again right so this will like kind of uh update the image that you have or I mean you can also kind of uh give a new name or you can like update it with like a new version as well so that's okay as well so this you can remember so we not going to do this but you can remember that you can redeploy with this Docker build uh command thing now what we are going to do is so we have uh tested our app in the local streamlet app and then we have built our Docker file with the necessary instruction and commands and the next step is also done which is building the docker image now the next step is running the docker uh container which is like kind of uh you know from this image we are kind of creating an instance in the runtime and that will actually act as our streamlet app so from that container we could access our streamlet app let's see how we could do that and for that we need to go to the home directory so I'll say a CD of to the home there can like follow all this com so we need to do Docker run 80280 ID so this image ID now we need to get this so there are some commands that you can run in order to kind of see the list of images that you have in your uh system right and this can also be done from Docker desktop when you're working on Windows uh I mean I think you also have Docker desktop in Linux but it wasn't like working properly for me so I just stayed with command line but in Windows you can actually see the image that you have built in the docker desktop and make sure that Docker desktop and the docker engine or running in your system before you do this Docker push and all these things because like that's a mandatory step so that's what we have seen here you shouldn't like start this and kind of like close your Docker desktop after this is done so should like keep running okay now let's say that pseudo Docker run but before that we need to get this image ID so for that we can say Docker images if I have mention that think it's not that but okay the command is Docker sudo Docker so this says the list of images that you have so I've already like uh built few images but the one that we built is this one so you can see it has been created 2 minutes ago so this I've created for some testing so and yeah this is the latest one and you can see the size is 81 m which is multile des prediction image and this is the image ID now we are going to Sayo Docker run and I'm going to replace this image ID so this 80 is because we have configured so we have like uh mapped our port to 80 so this is like kind of like the thing that we need to do as we have configured the port to listen to this particular you know at Port right so we say sudo Docker run iph P so for this four thing we have this p and 80 column 80 then we mention the image ID let's run this this will uh run the docker container and you kind of see the URL here you can just click on the URL and this will open your streamlet app right so now we kind of display the streamlet app but it's not just from P Cham it's it's we are kind of uh created a Docker container so basically this Docker container has all the required dependencies for this streamlet app so it can be this python 3.0 all the necessary libraries like numai Psy learn know streamlet Etc right so all these are now are kind of a package and the other Advantage is that now when you want to you know send this to a person who is testing this application you don't need send them this code so they just need to have Docker and then you just like kind of let's say send them the docker image let's say that you're pushing this to Docker and they just like can you know uh imported create a container and then just they can focus on testing the application rather than focusing on whether they need to change the python version whether they need to change the library version and so on so that's uh you know one thing so it's basically to containerize your entire application with all the requir things so that like it you know dependency wise and other aspects are like not affected and and our container our application is like isolated as let's maybe again test this with some values this in one way right Docker is so you can see the prediction here so Docker is just like a virtual machine that is isolated but it's like much uh kind of like convenient than a virtual machine so it's lightweight and and kind of like easy to deploy and so on so you don't kind of need to have a graphical user interface so like there are like more things this than just isolating or just having this Python and other libraries you can just kind of like do more research about this to so we have successfully ran our streamlet app as a container and we have accessed it from this port right so this port we would have given from config2 ml can see right so this and and then at is the port that we have so you can uh access it from this URL and I've tested this code on windows so in Windows this uh link won't work because like this is the link that you know uh this is the link that has in you know Docker container this is the port that it has and now when you access it from your host machine the PC that you're working on so the connection is not established so for that what you can do is in Windows you can just go to this Local Host so that will display this flamelet app so you can see that in Linux I could basically I have this connection but for in Windows like I couldn't access it from this particular IP and this particular Port so you can basically just go to local so there you will like see this app if you go this go to this particular URL right so you will just get an error so you don't have to worry about it just directly come to this uh Local H and you can uh check your streamlet app and finally we can do is this container is running and you can check the list of containers that's running in your machine so I'll just maybe create another uh terminal and say go to that Docker PS so this will list all the active containers that's running in my system again you can also see this from Docker desktop as well so this is my container ID this is my image and this is the command it runs and so on we have all this the next step is let's maybe stop this Docker container and delete this so I'm not going to use this anymore so I'm just going to delete this container let's see do that so I can just do a control C to stop this and again you can uh select this particular container and stop it from docket desktop now if you run this right so it it won't uh show you that container because it's not running but there is a way to see all the stopped container as well so it's not been deleted it's still there it's just that it's it's not running it will still occupy some space for that you can just say sudo Docker PS iph so this will like uh say that this is the container I container image and so on right and this says the status is exited so this is how you can see like theist of containers that kind of is present in system not the running alone you want to see the currently active containers you can just just do a sudo Docker PS now let's say that I'm not going to use this Docker container anymore I want to delete this for that you can do a Docker RM but there is another way let's say you have deployed this multiple time and you have like 10 containers you want to delete all those containers you can just do a Pudo Docker container PR copy this and this so this will ask for confirmation and now all the docker containers will remed now again I can run this sud sudo Docker PS iPhone a and it says that I don't have any containers running now as I said a Docker container is just a runtime instance deleting this won't delete the image that I have created so my Docker image will still be there so I can check this with dudo Docker uh images so also remember that we are running this uh in the home directory so it's not in the project directory so Docker command should run from the home directory only this Docker build you can navigate to the project directory and run it and it should work if you are kind of like uh running Docker bill from home directory but make sure that you are giving the proper path of this Docker file so that's so now we are done with this so first we have tested our application we have built a Docker file then we created a Docker image and also created an instance of Docker container and ran it now the next step is let's say that you want to share this uh Docker image that's where Docker up comes into play again it's like a repository for Docker images so you will also kind of find pre-built Docker images on which you can create some containers you can just like change some files and you can like kind of update something and can run in your say you don't want to create that image from scratch you can can just pull it from there and you can like work on it the other thing now let's see how we could this to Docker up so these are the next set of rules that we need to which is first is signing up to Docker up so is connection fail because we have deleted our and deleted so go to do sign up for this and then you can uh do a login from the terminal itself be may need this image ID later so first is signing up to Docker up and then we need to create a repository in order to store this Docker image I'll go here uh you can this explore repos and organ here this repository here I can H repository so these are the two commments that we need to do in order to First tag our uh image local image to this repository and then push it to this repository so for this reposit I'll sayet not but let's see you can put a description about this so that this is ml streamlet app or multiple this prediction so you can have like private or a public so I'm just having like a public repository so you can just save this uh commands somewhere so also have this in my read me first I'll create my repository so the next step is tagging our local image to this particular uh repository so for this this is my username so you would have a username and the repository name these are the two things that we need let's come here you can follow all the commments that I've given here just you know change all those image IDs username name okay we have signed up to doab and have created a repository on doab next is log to doab from the terminal so you can login with your password or access token I didn't add that particular command here but you can just do uh Docker login maybe I'll update this in my git reposit so Docker login there are two ways to log into this one is password and and then there is access token you can also have a two Factor authentication in order to you know kind of secure your account doer login I've already logged in so I don't have to put this Lo thing again so that is done then the next step is tagging your local Docker image to the docker repository just copy this command here so I need this image ID so the image ID is the one that we have created 9 minutes ago so copy the image ID from here this sudo Docker tag you can use uh again the name or the you know image ID I'm going with ID for you know better usage so now I need to replace this username and repository that actually can get it from your username and the repository name tag copy this tag name you can give so it can be again that version or [Music] so this so it should be my username slash my repository name tag tag name let's maybe let's also call this as V1 same version here right so now this model is tagged with this name it's sudo Docker images now you can see this uh this is the tag that I done so 15 minutes ago but this is with the repository so it's just like a copy of the local uh image that I have now I'm going to push this so for pushing you don't need to you know give the name of this local image again you can just copy what you see here paste it here and just replace the tag name tag name is v1.0 I'll just copy this this should be sufficient so you don't need this image ID anymore you see the image ID will be the same for both just need to do here as push I'll do audo Docker push username SL repository name then the tag which is V 1.0 let's this will push my local Docker image to Docker reposit so take like a seconds see the docker getting time we would see it there okay maybe in the meantime let's kind of go through what we have done so I hope you are clear till the step I mean there could be few things that could go wrong it can be some uh you may not have admin access and some things can go wrong but you should be able to find this shouldn't be complex let's again go through what we have done so we have a streamlit folder so it's okay if you you know have all these things in this particular uh code structure so that should work as well if not also it shouldn't be a problem as long as you mention the directory names like properly let's go through this readme file again first step is we are going to make sure that first we have you know installed the requ libr libraries in our system to test the streamlet app locally so we do that by pip install our requirements. TX and then we run our streamlet app with streamlet run app.py the next step is like again testing with some values for a streamlet app and so on now we need to install Docker maybe for Linux or not Docker desktop for Windows or Mac OS and then we need to start the docker engine so this I'm starting with sudo system CTL start Docker for Linux and for Windows as I said you can start the docker engine from Docker desktop next is building your uh Docker image and and remember to run this from your home directory and uh the next step is building it with P sudo Docker build T which is just just like the tagging that we did with uh with some image name for your uh app that we have created and some tag so v1.1 1.2 or something like that and this dot is important which is basically like saying that I want to copy all this uh know files from this root directory or not the root directory from the working project directory to the uh app directory of my Docker container right so when I say dot it's it's basically the you know directory of this Docker file and if you just quickly go through this Docker file so we have this python version thing that I want to copy all those things from whatever is present uh you know along with this Docker file I need to put it to app folder of Docker container then I'm changing this working directory this pip install requirements exposing the port which we have also seen that this is the port that we can kind of take our stream the up and then we are creating uh streamed folder in the root directory and here we need to kind of like save this config DOL and credentials these are like some you know files that the Stream app needs and then you have this entry points as the Comm stream and run and we say that I want to run this app.py so once these are done we do this build so all these steps run when we do this Docker build with some tag name and then we are going to check if the image has been built properly and we are going to get the image ID by running sud sudo Docker images and again whatever like Docker comments that you're running make sure that you're running it from the home directory now you have this sudo Docker run iPhone P which is to specify the port of 0 and then the the image ID so this will start your Docker container and it will also display the port on which you can access your web app which is this this is the URL using which we can access and if you are in Windows you probably will go to local what is the case for Mac I mean if you can comment it that would be good as well like would like to know like how you would access that in Mac I think work with this URL but again I'm not sure about that and next is like you can kind of see the list of uh currently active Docker containers with Docker PS command you can stop it with control+ C from the terminal or you can also stop it from the docker desktop and you can kind of see active Dockers and also the ones that has like stopped with this PS iPhone a command then if you want to delete a bunch of uh containers you can do a Docker container prune where we are just like pruning the containers so just like delete now the next step is uh pushing this to Docker right so we are signing up to Docker up creating a repository and and now the next step is logging it from logging in from the terminal with Docker login sudo Docker login and then we need to tag uh this image ID with uh the username for our Docker up and the repository name that we repository that we have created so if you see we have created the repository after that and put a tag for that and later we can just do a Docker push username tag so finally if you want to remove your uh uh you know image you can just do this Docker RMI so remove image and and if is like force kind of like force deleting it maybe I'll the docker has been pushed got this deleting thing the this so this probably you can share this depository to someone and you can kind of like use it so we have this version and then we have like uh Linux architecture right so basically the containers are like the Linux containers that we are building so yeah this is about it so we can this TXS see like all the things that the right so this is about it if you want you can delete this tag and let's say that you have you don't want this Docker image anymore you can also see that it's like quite big so it's around like 1 GB of size or something you want to delete it you can delete the repository just go to the settings and it would you to kind of you scroll below there will be a delete option you just need to copy the name of the repos and paste it now let's see how we can delete a repository so let's say that you have deleted the image from the repository you want to delete it from your local system you see have this uh of uh images with this particular image ID I'm going to remove this if this will work but let's try this without uh Force Del Docker probably because I don't I don't repository for this is the latest able to delete must be for so this has been untacked from the repository and now this has been deleted so do this Docker now this is the docker image that I've just now right the Creator time and this is the repository the one that is tagged to repository so if you want to delete this can again delete this in your local or you can delete it in your repository as well so so that if you don't want this you can just delete it any time that you want so that is all from my side and yeah just do this so you can just like have all these files under it so I mean again you can have this in the same folder path as VNV or you can create another folder just like I've shown you right app can also like work with it I mean both should be fine so this should changing this folder thing shouldn't change anything in these comments so if you just you can open this Mark read me. Mark file or you can just scroll below to see all the commments have I just add this command for logging into Docker and the just command so probably like I'll add it so all from my side and I hope you have understood and this video I'm sure that you will try this out so this is like an exciting yeah let's uh see you later then by
Info
Channel: Siddhardhan
Views: 3,855
Rating: undefined out of 5
Keywords: Machine Learning, Streamlit Tutorial, Docker Containers, ML App Deployment, Streamlit 2024, Docker Tutorial, Python Programming, Data Science, Streamlit Docker Integration, Tech Tutorials, Deploy ML Model, Streamlit for Beginners, ML Deployment, Streamlit Deployment, Docker Best Practices, ML Application, Containerization, Python Projects, Data Science Projects, Streamlit Python Tutorial, Docker in Data Science, Scalable ML Deployment, Streamlit Web App, ML in Production
Id: 5pPTNzUcIxg
Channel Id: undefined
Length: 48min 2sec (2882 seconds)
Published: Tue Jan 09 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.