Info |
---|
Welcome back. If you look at the darker files that we have used to launch up the Java application we use something called entry point and to launch up the no JS and Python applications. We use something called CMT C Monty Python launched R B way CMB node index which is now what is the difference between CMB and entry point and when should you make use of which one. Right that's important question that you need to understand and let's look at that in this specific step it's clear. And let's look at all the containers which are running and make sure that you kill everything that's present in here. So docker container less dock. Dean stop by a forty three okay. If I was taking a little while let's wait okay. Docker container store food three. So we don't really have anything running right now. Let's do a clear and now let's pick a part of the command which we use to run things earlier so dock again detached mode hyphen B fighters and 1 5000 no JS 0 0 3 release. So this was what we ran earlier and to this I'm adding in space and adding in being Google dot com. So what I'm doing is the earlier command followed by space followed by being green dot com and a container is created. Let's do a docker logs if any of these groups you can see that it's keeping on pinging. Google dot com and let's see if the application is up and running. It's on 5000 right. So you can see that the application is not really running. So that first observation. We saw that when we ran the hello world notice application with Bing to Google dot com. What happened was the application was not launched properly and Bing Google dot com was being executed. What I'll do is I'll change to with Java and we only built it up to zero point zero point to get release and let's change the world of it to be five thousand. We already have something that anyone five doesn't want to let you try it doesn't want and executed. So now let's follow the logs cut logs if enough and follow this. Okay. It's starting up should take a few seconds to start up okay. The application is up and running. It's on 5000 right. So five thousand is good. So. But you see that the ping to Google dot com is not going on. So for the job application the application is running fine and the ping is not overriding. Whatever launch thing that we have said. So if you look at the Java container building dock a file you'll see that we are using entry point. Now if you look at the Java dock I find so Hallowell Java dock a fairly basic entry point. However the node is dock of I use this C M.D. so it is using a CMB command. So what is the difference between CMB and entry point. The thing is with CMB What do you pass from the command line will replace the instructions you wanted to execute. So this container if you are actually let me disconnect from here and actually look at it is too clear. And let's look at the command which we used to run. So here we are passing a few command line parameters ping ghoul dot com. What happens with CMT is these parameters will be replaced by whatever you are passing in here. So the comment the application will not be launched. And that would be replaced by being Google dot com. However entry point does not worry about command line arguments. Now when you lose an entry point and when the user command let's say there is a chance that instead of running node index charges there might be a new file which might be used to run the entire application to let's say index one dodges index to Dodge's index three dodges in that kind of situation. You can simply so that you can override the command which you would want to execute in here but when you don't want to override the command when you want this to be static when you want every day Hello World Java Dodger is the first thing that should be executed when this application is launched. Then you'd go for an entry point. So I already provided instructions in here entry point instructions for both energies and Python as well. If you think that this launch that might be why does not change at all or lose you'd want to use launch that way. I would recommend you to use entry point and the same is the case with no JS as well. Now we looked at the difference between CMB and entry point before we end. There is one thing that we need to know about entry point. The thing is even entry point can be overwritten but it will not be overridden by a command line argument. But to override the entry point you need to actually pass in an option you can use in a given called entry point and specify the entry point in here. So the key difference is that if you pass a command line argument it would override the CMT however or writing entry points are much more complex and so entry points are much preferred approach to launch your application up if you'd want to launch the same thing up every time. I'm sure you are having a wonderful time and I'll see in the next day up until then well I. |
Page History
Overview
Content Tools