53:17
2025-05-05 09:45:33
Visit the Dockers and Kubernetes (5-7 May 9am to 5pm) course recordings page
WEBVTT
-->
Oh yeah, it will show. That's very nice.
-->
Yeah, actually it's better, I can see everyone.
-->
Okay, cool.
-->
Guys, I can see what you are doing, but if I constantly want to come and check, it's like you guys will get confused.
-->
So, if you have problem, if you missed some step, please let me know.
-->
Okay, I've been done here.
-->
I'm gonna clear my screen.
-->
So, you guys have a better view.
-->
Now, I've done...
-->
I just thought I missed it already. So, after sudo get update, so what's the next command?
-->
sudo apt upgrade. Let me find the chat here.
-->
sudo apt upgrade.
-->
And put dash y, so it doesn't...
-->
If you don't put dash y, it's gonna ask you yes or no.
-->
So, if you put dash y, it means that whatever question, just ask yes.
-->
Just answer yes.
-->
Okay?
-->
The next step, I'm gonna go and install my CA certificate.
-->
This one is gonna take very fast. You can see it's already been installed.
-->
It's pretty easy. You just need to go and do it one by one.
-->
You can see here, up here, there is a copy button.
-->
You can copy and paste them once together, but I don't really advise you,
-->
because most of the time I saw it's gonna face some sort of problem.
-->
So, just double click on each line, copy, and use ctrl-shift-v.
-->
It will paste it for you.
-->
If you use ctrl-shift-v, it will paste it for you.
-->
And you can, like, it will execute the plan.
-->
So, it's not that hard.
-->
And again, I'm gonna copy.
-->
And finally, this part, these lines have to be copied together.
-->
I'm gonna copy.
-->
Okay.
-->
Now, I'm gonna update it again.
-->
Okay.
-->
And finally, I'm gonna install this one.
-->
Okay.
-->
And now, to be sure, if I put Docker,
-->
dash-dash-version,
-->
you can see, it says that my Docker is ready.
-->
Okay, let me check.
-->
You guys are up to...
-->
Okay.
-->
Oh, most of you guys are still in update.
-->
HN, who's H-N-I-N?
-->
H-N-I-N.
-->
Couching and switching.
-->
H-N-I-N.
-->
Is it...
-->
Is it, wait, let me see.
-->
Okay, I cannot go into the terminal.
-->
Just wait a moment.
-->
Just type here.
-->
I can see your menu is open.
-->
Just type terminal.
-->
Type terminal.
-->
Okay.
-->
Okay.
-->
Can you please write sudo apt update?
-->
Apt.
-->
A-B-T.
-->
No, no, no, no, no dash.
-->
Apt.
-->
A-B-T.
-->
Space, update.
-->
Okay.
-->
Okay.
-->
Okay, I can see.
-->
I think Houching is done.
-->
Missed wait time.
-->
Okay, guys.
-->
Just, can you please just type docker dash dash version
-->
and see if you can get,
-->
like you can get this Docker version message.
-->
Just clear your terminal.
-->
Yeah.
-->
Okay, I can see Houching get it.
-->
Let's see, get it.
-->
No way.
-->
Houching, did you get it?
-->
Dash dash version.
-->
Okay.
-->
Actually, you don't...
-->
Oh, you have a problem with installation.
-->
I think you jumped a few steps.
-->
Yeah.
-->
You jumped a few steps.
-->
Missed wait.
-->
Here, look at here.
-->
Look at me.
-->
This one, after this, you have to copy and paste
-->
the entire thing in one line.
-->
This part.
-->
That's the reason you failed to install it.
-->
You missed this part.
-->
No, no, no.
-->
You haven't finished installation.
-->
Come back here.
-->
And after this, you need to install this part.
-->
You need to install this line, entire this line.
-->
Okay.
-->
I think you missed.
-->
Okay.
-->
I think you missed more than that line.
-->
Here.
-->
Go and do it from the beginning.
-->
This line first, second, third, fourth, fifth.
-->
And this is a sixth line.
-->
This update is not necessary, but it's better to be there.
-->
And then copy and paste this one.
-->
It's one by one.
-->
You mean I need to do it from start, right?
-->
Yeah.
-->
Do it from start.
-->
Because apparently you missed a line.
-->
I'm not sure which line did you miss.
-->
But one of the lines you might be missing.
-->
Okay.
-->
That is fine.
-->
That else is fine.
-->
Why?
-->
Why?
-->
And that.
-->
Okay.
-->
Now please put a dash version.
-->
No, no, no.
-->
Put that one, doesn't it?
-->
Put like a dash, dash version.
-->
Dash, dash.
-->
For version, you have to put dash, dash.
-->
No, before.
-->
Before version.
-->
No, space.
-->
There should be a space between.
-->
Okay.
-->
No space before version.
-->
Okay.
-->
Yeah.
-->
Okay.
-->
Cool.
-->
You can see your version is done.
-->
Okay.
-->
I can see all of you installed.
-->
This installation, it's whether you want to like give you Ubuntu, like if you want
-->
to go to your cloud system, GCP, and you want to just have bare metal, just Ubuntu
-->
in a server, you have to implement the same feature.
-->
This is going to be the same for the Mac and Linux.
-->
But if you have a Windows, Windows for those of you guys want to use Windows on your
-->
own machine, you can come to Docker desktop.
-->
Just you should Google Docker desktop.
-->
Come here and download Docker desktop.
-->
Download Docker desktop.
-->
Of course, in Windows, it gives you much better environment.
-->
You can see it will give you very good like ecosystem and it will automatically
-->
install for you.
-->
So if I come to my PowerShell in Windows now, in PowerShell, actually I needed to
-->
wait for booting up the Docker like Docker engine for my Windows.
-->
If I come to my PowerShell, a few seconds to boot up, which I'm going to use it
-->
much more later on.
-->
If I put Docker dash dash version here, you can see you can see it will automatically
-->
install for my Windows.
-->
So for Windows, you don't need to copy and paste any command.
-->
The only thing you need to do is just downloading Docker desktop, install it in Windows,
-->
and it's going to be good to go.
-->
Anyway, let's go back to the let's go back to here.
-->
I'm going to clear my screen.
-->
There are a few things you need to know.
-->
We have two concepts here, which I talked.
-->
I'm going to answer like share my screen and I'm going to go to the whiteboard.
-->
OK, that has two concepts.
-->
One concept is image.
-->
One concept is one concept is image.
-->
Another concept is container.
-->
So the image is a boilerplate thing, which we create as a programmer and they
-->
deliver it to the DevOps engineer.
-->
So we have an image.
-->
Let's consider my image is let's say engine X.
-->
So my engine X image is going to be delivered based on my programming.
-->
It can be react.
-->
It can be HTML, PHP, whatever.
-->
I'm going to make it is this image is going to go to the container registry
-->
in the container registry.
-->
This is container registry in the container registry.
-->
They're going to be multiple images.
-->
OK, they're going to be multiple images.
-->
It's going to be my back end.
-->
Maybe it's going to be in C sharp.
-->
It's going to be my front end, which is engine X.
-->
They're going to be my database.
-->
Let's say, for example, my SQL or something.
-->
So these images are going to be in the container registry, but not going to
-->
be in my PC.
-->
In my PC, if I check right now, I wouldn't find anything.
-->
Then these images can be pulled.
-->
It's exactly like GitHub or any Git.
-->
This is going to be this is my PC.
-->
Let's come here.
-->
This is going to be my local PC.
-->
I can easily download them into my local PC.
-->
And then I will have those images in my PC.
-->
I will have those images in my PC.
-->
So after I have those images in my PC, now I can make a decision.
-->
I want to make them container or not.
-->
Do I want to do those images?
-->
Do I want to like containerize them or not?
-->
OK.
-->
So this can be again back end, front end, and they're going to be database.
-->
OK.
-->
Any question?
-->
OK.
-->
Let's go back to my share screen.
-->
OK.
-->
The biggest repository is going to be Docker Hub.
-->
OK.
-->
In Docker Hub, if you just go to Docker Hub, actually for me it's like for me
-->
Docker Hub because I've been there so many times.
-->
For you guys, just come to the Google and search for Docker Hub.
-->
Let's keep going to my.
-->
OK.
-->
If you go to Docker Hub, you can see the first one shows you the Docker Hub,
-->
which shows all the images.
-->
If I come back here in my terminal, if I put Docker images,
-->
you can see I have actually I need to use the sudo app, sudo Docker images.
-->
You can see I have nothing here.
-->
In your PC, you don't really need to use sudo because sudo give me admin access.
-->
But here it told me I don't have enough permissions, so I use sudo.
-->
I have no images here.
-->
OK.
-->
Let's go to Docker Hub.
-->
I'm going to search for nginx.
-->
I'm going to have nginx.
-->
I would like to have nginx images in my PC.
-->
So here, if I come to nginx in Docker Hub, you can see I will find the Docker pool nginx.
-->
And they're going to be, you can see, the first one, which is an overview,
-->
is a basic documentation of nginx,
-->
which tell me every single thing about nginx.
-->
Like all of them, I'm going to explain later on how to create your own frontend based on nginx,
-->
the environmental variable, the volume, all these fine things I'm going to teach you later on.
-->
Up here, you can see there is another one which called tags,
-->
which tags are specific images.
-->
By default, all of them are based on Ubuntu.
-->
But one of the Linux which getting very famous these days is Linux Alpine.
-->
Linux Alpine is very common because it's very light.
-->
Later on, I will show you the difference,
-->
but all these images you can see it will tell you,
-->
okay, what is the size of the image here?
-->
And like you can choose, depends on resources, to which one you choose.
-->
By default, it always go to the Ubuntu one.
-->
If I put Docker pool nginx here,
-->
if I put Docker pool nginx,
-->
actually I need to have like sudo to give me like full permission, admin permission,
-->
it will begin pooling nginx from the Docker hub into my local PC.
-->
Into my local PC or if it's a server, it's going to be in the server.
-->
So if right now I put Docker images, sudo Docker images,
-->
you can see my nginx is already been pooled.
-->
It means that now in my PC, I have my nginx image having my PC.
-->
Actually the size you can see is 192.
-->
Why? Because this is a Ubuntu version.
-->
Let me get rid of the extra one.
-->
So if you look at here, instead of like Ubuntu,
-->
if I was making stable pal, it will just get 78 megabytes.
-->
But now because I use the regular Ubuntu, you can see it's quite heavy.
-->
It's 192 megabytes.
-->
When it's come to this nginx is not really important, but later on you will see my own image is 2 gigabyte.
-->
So like 2 gigabyte is quite heavy image.
-->
So when it's come like a larger microservices, it's getting very important.
-->
What image do we use?
-->
OK.
-->
OK, this is an initial step.
-->
But I don't want like definitely this is just image.
-->
It means that it's not deployed.
-->
We have another command, which is Docker.
-->
Let me use sudo this time.
-->
Docker PS.
-->
Docker PS shows the containers.
-->
If you remember from a few minutes ago, I said images are just a raw software.
-->
It's not deployed in your system.
-->
I just pulled.
-->
I just it seems that it's an installation file with Docker pool.
-->
I just download that installation file in my system, but it's not run there yet.
-->
How I can understand whether it's run or not, I have to use Docker PS.
-->
Docker PS you can see.
-->
Let me actually clear my screen so you can have a better idea.
-->
If I put sudo Docker images, you can see it will show me what images I have already downloaded in my PC.
-->
If I put sudo Docker PS, it will show which of the images which I downloaded in my PC is already been like deployed.
-->
Already been installed, which for me is none right now.
-->
So I wanna install it.
-->
What command do I need to use?
-->
sudo docker run.
-->
This one is a this one is not very like complicated one.
-->
Actually sudo docker run alone is not gonna work always.
-->
For this time, it's exceptionally.
-->
I'm gonna just go with no environmental variable.
-->
I'm gonna run either my image tag ID or my name.
-->
For this one, because I haven't like go to image ID, I will just go like nginx.
-->
If I run this one, you can see it will begin the process of installation.
-->
It will do the process of installation.
-->
And you can see it will already installed.
-->
If I stop it, it will be gone.
-->
So what I'm gonna do, I'm gonna open a new terminal because this is Linux.
-->
You can have as many terminal as you want.
-->
If you look at here, if I put sudo docker ps again, you can see my nginx image is running.
-->
My nginx image is running.
-->
And it already gave it a name, which the name is pasteful pane, something like that.
-->
Later on I will teach you how to give it a name.
-->
And it's allocated port 80 automatically.
-->
If I stop it here, if I stop it, I just put control x to stop it.
-->
You can see if I put docker ps again here, nothing is running.
-->
But you might tell me, okay, it's already installed.
-->
So where did it go? Where did it go?
-->
I'm gonna close this one and clear my page.
-->
If I put sudo docker images, you can see the installation file is still gonna be there.
-->
sudo docker ps, the container is not running there.
-->
So it's not there, but it's in assault.
-->
So it's in the background of my docker.
-->
So if I put sudo docker ps dash all dash a, it will show me this container is already in assault.
-->
It already was working for like, but 40 seconds, 41 seconds ago, it's been terminated.
-->
So you might ask me, okay, if anytime I close down my terminal, because you know, the moment I close down the terminal, because if I run it again and like I go with another terminal,
-->
if I put another terminal, I can see this is gonna work.
-->
sudo docker ps, it's working.
-->
But the moment I close down this terminal, yeah, I will say, okay, close the terminal.
-->
If I run it again, actually, this is running because you know, I put it in the, it's gonna automatically new version, put it in detach mode.
-->
So it's gonna be like it's gonna be gone.
-->
This is just because of new version of docker.
-->
If you go older version, it doesn't put it in detach mode automatically.
-->
But this put that in detach mode.
-->
So but like, I'm gonna show you the standard way of putting in detach mode.
-->
So what I'm gonna do, I'm gonna go sudo docker ps.
-->
And now imagine that the image you want to stop it.
-->
I will put sudo docker stop.
-->
And I will name the I can use the container ID or the name.
-->
Okay, I'm gonna put the container ID.
-->
You might ask why I didn't use nginx.
-->
Because nginx is the name of image, not the name of the container.
-->
The name of container is priceless underscore jank, which is like randomly given by docker automatically.
-->
Okay, so if I put docker stop, actually docker stop nginx.
-->
You can see it said a new container name nginx.
-->
So if I want to stop it, I have to use the name which docker allocated automatically or the container ID.
-->
I have both option.
-->
So in this case, I'm gonna copy and I'm gonna paste the name which is docker automatically given.
-->
So now if I put sudo docker ps, you can see it's not there.
-->
Automatically docker put it in detach mode in a new version.
-->
But if you want to do it really in the detach mode without without like using the newest docker feature,
-->
I just need to put sudo docker run nginx and dash dd.
-->
If I put dash d, it means that run it in detach mode.
-->
Run it in detach mode.
-->
So I'm gonna run it.
-->
You can see nginx.
-->
Oh, nginx.
-->
I made a mistake and there's a typo error.
-->
Nginx.
-->
Okay.
-->
You can see this is automatically sudo docker.
-->
sudo run nginx nginx dash dash d detach.
-->
Sometimes sometimes dash d is usually working,
-->
but sometimes it will confuse it for like it will the docker will confuse it with environmental variables.
-->
So I will put it the full name detach.
-->
Okay.
-->
I'm not sure what is the problem.
-->
Okay.
-->
Images sudo.
-->
Okay.
-->
Yes, dash dash all.
-->
Okay.
-->
So many in a cell sudo docker delete delete.
-->
Maybe they're going to be a conflict.
-->
All right.
-->
Sorry.
-->
That's Kubernetes.
-->
Kubernetes we use remove.
-->
So if I want to delete them, I'm going to delete all of them one by one.
-->
I can put container ID one by one.
-->
To remove them.
-->
I assume those making.
-->
What?
-->
Yes.
-->
You guys continue here.
-->
I'm not sure why this one just jumped out.
-->
Terminal.
-->
Okay.
-->
sudo docker.
-->
Yes.
-->
Okay.
-->
sudo docker rm.
-->
You can delete each of them one by one.
-->
So if I put sudo docker psa again, we can see that container is no longer existing.
-->
If the container no longer is existing does not mean that that container is is that container.
-->
The images delete as well.
-->
So this is one of the mistakes many people do.
-->
First of all, let me like delete everything else.
-->
Docker rm.
-->
Let's delete everything else.
-->
There's a conflict between zoom commands.
-->
And this is the desktop.
-->
Okay.
-->
So if I put right now sudo docker ps-a, you can see no container exists anymore.
-->
But if I put sudo docker images, you can see the container.
-->
The image is still there.
-->
The image is still there.
-->
You don't necessarily need to necessarily need to always pull the image.
-->
If I go there and look for Apache because nginx is one.
-->
Apache is another one.
-->
Apache.
-->
I'm gonna go Apache.
-->
It's gonna be Apache.
-->
HTTP.
-->
HTTP because it's like HTTP is like nginx, but it is by Apache.
-->
Instead of docker pool, if I run docker run.
-->
HTTP.
-->
You can see unable to find in an image HTTP the latest locally, so it will automatically go to the docker hub and fetch it.
-->
Okay.
-->
If I am gonna leave it like this one on.
-->
I will go to the sudo docker ps.
-->
You can see Apache is running.
-->
And I will go docker images.
-->
You can see HTTP is already been pulled automatically.
-->
HTTP automatically been pulled.
-->
So it means that HTTP like if image is if the image is not like if the image is hosted in docker hub.
-->
This is if you use your own GCP container registry.
-->
You have to give it the exact location and you have to give a necessary permission.
-->
But if the image is located in docker hub, you don't necessarily need to pull it all the base.
-->
You just need to push pull it.
-->
Run it.
-->
It will be pulled.
-->
Okay.
-->
But you can see these are like this is just 300 megabyte and I haven't run any app.
-->
Which is not so much, but eventually even the number of apps are getting so many that 300 megabytes is a lot.
-->
So I'm gonna terminate.
-->
I'm gonna go sudo docker ps-a.
-->
I'm gonna remove this one sudo docker rm.
-->
I'm gonna remove this container ID.
-->
So this container is no longer existing.
-->
Imagine that you don't I no longer wants my images.
-->
So you can see my images are there.
-->
But I don't want HTTP.
-->
Because HTTP and nginx both of them are same.
-->
Both of them to portray the front end into the web.
-->
But imagine that I don't want the HTTP to any longer exist.
-->
So what I need I need to write sudo docker rmi.
-->
And I need to either name the name of the image or use the ID.
-->
Which I in this case I'm gonna use the ID.
-->
I will put Ctrl Shift V.
-->
You can see all of them deleted.
-->
So if I put sudo docker images now.
-->
sudo docker images.
-->
You can see HTTP is no longer existing.
-->
It's deleted from my disk.
-->
Okay.
-->
I will give you a few minutes for you to play around as well.
-->
Try to use that.
-->
And by the way.
-->
I already prepared the commands for you guys.
-->
In Google Classroom which you guys just joined.
-->
I put the commands in Google for you guys.
-->
In Google Classroom.
-->
If any commands you forget.
-->
Here you can see this one.
-->
This one is like.
-->
This one is a sample file.
-->
I'm gonna work.
-->
This one is you can see it's like it's a PDF file.
-->
All the commands are gonna be there.
-->
So all the commands I'm telling you.
-->
Just learn it.
-->
You don't need to write it down.
-->
I mean if this is method of learning for you.
-->
If you think if you write it down you will learn it better.
-->
Feel free to take a note.
-->
But if you like.
-->
If you can learn it here.
-->
Don't worry.
-->
All the commands are in the Google Classroom.
-->
So you can later on refer to the Google Classroom.
-->
And check the commands.
-->
So you don't really need to note it down.
-->
Okay.
-->
Let me see.
-->
How's everyone going on.
-->
How's everyone going on with ULC.
-->
Httpd.
-->
Control C.
-->
Control C.
-->
Control C.
-->
Control C will terminate.
-->
You have to be careful.
-->
First.
-->
This is one thing.
-->
In Linux Terminal.
-->
Control C is termination.
-->
So Control C.
-->
You can not use Control C.
-->
To like.
-->
You can not use Control C.
-->
To copy and paste some stuff.
-->
Actually for me.
-->
For Terminal is Control Shift C.
-->
If you are using Windows.
-->
I think most of you guys are using Windows.
-->
It is Control Shift C.
-->
But for me I can not use Control Shift C.
-->
Because Control Shift C is a command.
-->
For the zoom.
-->
So I can not use Control Shift C.
-->
Because it makes a conflict with my zoom.
-->
Pretty good.
-->
Fairly.
-->
Fairly can you remove Nginx.
-->
Just remove it.
-->
Just remove the image.
-->
Because you don't really need that image.
-->
It was just for the purpose of training.
-->
Okay.
-->
Okay.
-->
Let's make it a little bit more.
-->
A little bit more.
-->
Like.
-->
Sophisticated.
-->
Because the fact about.
-->
The fact about the like.
-->
Docker.
-->
When you run the command.
-->
You can give it so much different.
-->
Environmental variable.
-->
Naming.
-->
Because if you remember.
-->
It was something.
-->
Jank.
-->
Something.
-->
Name.
-->
Which I don't like it.
-->
So if I put sudo.
-->
Docker.
-->
Run.
-->
Httpd.
-->
Always put the.
-->
Put the.
-->
Httpd at the end.
-->
The image name at the end.
-->
I can put dash dash name.
-->
And after I put dash dash name.
-->
Space.
-->
I can give it a space.
-->
I can say frontend for example.
-->
I can give the container the name of the frontend.
-->
And I want to say put it in.
-->
Detach mode.
-->
So I will put dash dash frontend.
-->
And put it in detach mode.
-->
If I run it.
-->
You can see obviously.
-->
Because you guys saw that.
-->
I already deleted my.
-->
Httpd.
-->
I already deleted my.
-->
Httpd.
-->
So it's not there.
-->
So it said that unable to find.
-->
Httpd locally.
-->
Pulling from a library.
-->
You can see I run sudo.
-->
Docker.
-->
The sudo is not necessarily.
-->
It's just because I don't have an admin access.
-->
I run sudo.
-->
I gave a name of frontend.
-->
And I put it in detach mode.
-->
So you can see this one when I run it.
-->
I can continue to use my terminal.
-->
And if I put.
-->
My Docker PS.
-->
Sudo Docker PS.
-->
You can see.
-->
My container is fully running.
-->
And still I can use my terminal.
-->
And the name is no longer that weird.
-->
Like whatever weird name.
-->
Docker used to gave to my container.
-->
You can see now.
-->
The name is frontend.
-->
So I can communicate it.
-->
I can put.
-->
Sudo.
-->
Docker.
-->
Stop.
-->
For example.
-->
Frontend.
-->
Ok.
-->
Sudo.
-->
Docker.
-->
Stop.
-->
This is.
-->
Type error.
-->
Front.
-->
Front.
-->
End.
-->
Ok.
-->
You can see now.
-->
Sudo Docker is stopping this container for me.
-->
So if I put Sudo Docker PS.
-->
It's no longer there.
-->
I can start it.
-->
Sudo.
-->
Docker.
-->
Start.
-->
Frontend.
-->
Ok.
-->
You can see it begins starting for me.
-->
Naming is very important in many cases.
-->
Because if I don't give it a name.
-->
Anytime.
-->
I have.
-->
Anytime.
-->
I want to start it and end it.
-->
Anytime.
-->
I want to start it and end it.
-->
I have to go and see container ID.
-->
And you can see the container ID will be same.
-->
Will be same.
-->
But I have to just go and do Docker PS-A.
-->
Find my container ID and run it.
-->
So it's better to give it a name.
-->
Anytime you want to run it.
-->
You will be able to run it.
-->
Ok.
-->
Any questions till now?
-->
No questions?
-->
Ok.
-->
Ok.
-->
Thank you.
-->
Ok.
-->
One thing you can see here.
-->
Is a port.
-->
Which is 8080.
-->
Now I want to run my Nginx.
-->
My Nginx.
-->
If I put Sudo Docker run Nginx.
-->
Dash.
-->
I will actually let me push dash.
-->
I will give it a dash dash name.
-->
Of Nginx frontend.
-->
I will give it a Nginx frontend name.
-->
Let's put it like underscore.
-->
And I want to run this one in detached mode as well.
-->
You can see this is running.
-->
If I put Sudo Docker PS.
-->
You can see both of them are running in port 80.
-->
Ok.
-->
Both of them are running in port 80.
-->
But I might not like it.
-->
Because you know I don't want to port 80 to run.
-->
So what if I don't want to run it in port 80.
-->
So I'm gonna first terminate this one.
-->
Docker RM.
-->
Nginx.
-->
Nginx.
-->
Frontend.
-->
Ok.
-->
Actually I have to stop it and run it.
-->
And remove it.
-->
But there is a hack.
-->
Which is not very good.
-->
But you can put dash F.
-->
Which is you forcefully say that terminate it.
-->
Because you know.
-->
The proper DevOps thing is that stopping the container.
-->
And then remove it.
-->
But here it's not a real production environment.
-->
So I'm just forcing it.
-->
I don't stop it.
-->
You saw how to stop and remove it.
-->
But I just forcefully stop it.
-->
So if I put this one.
-->
Sudo.
-->
Docker PS.
-->
You can see my Nginx is no longer running.
-->
But what if I want the Nginx.
-->
To run on port 80.
-->
Instead of 80.
-->
Ok.
-->
So I will put Sudo.
-->
Docker.
-->
Run.
-->
Nginx.
-->
Actually Nginx I will put it at the end.
-->
Dash name.
-->
First let's give it a name.
-->
Dash, dash name.
-->
Of Nginx.
-->
Frontend.
-->
I can give it a port.
-->
I will say ok.
-->
Run it.
-->
Dash P.
-->
Run it on port 8080.
-->
But there is a inside container.
-->
Ok.
-->
I have to say what is going to be inside container.
-->
Which is port 80.
-->
I'm going to soon.
-->
Very soon I will tell you what is inside port container.
-->
I want to have it in detached mode.
-->
And I want to have it use my Nginx image.
-->
So you can see the name is Nginx frontend.
-->
The port is 8080.
-->
280.
-->
And I want to run it in detached mode.
-->
Of what image?
-->
Nginx.
-->
Now it's running.
-->
If I put Sudo.
-->
Docker.
-->
PS.
-->
You can see this is 8080 to 80.
-->
My Nginx frontend.
-->
Ok.
-->
You might a little bit get confused.
-->
What does it mean 8080 to 80.
-->
Which I'm going to explain it right now.
-->
Ok.
-->
I will give you a time to run and do it by yourself.
-->
Then we will go to the like white port.
-->
Ok.
-->
Very nice.
-->
Let me see how's LC.
-->
Ok.
-->
LC.
-->
Actually it's very good.
-->
You know.
-->
Do you know why you cannot remove your hello port.
-->
You put Sudo.
-->
Docker.
-->
PS.
-->
Sudo.
-->
Docker.
-->
PS.
-->
That's that.
-->
That's a space.
-->
That's a.
-->
Enter.
-->
You can see your hello port is there.
-->
It is not running container.
-->
It is not running container.
-->
But the problem with this hello port.
-->
It's not running container.
-->
But it is an unrunning container in your machine.
-->
So you want to remove the image.
-->
It doesn't allow you.
-->
Because based on that image.
-->
Some container is running.
-->
It's true.
-->
It's not running container.
-->
But still it's working behind your machine.
-->
So you have to remove it.
-->
So you can see.
-->
Because you haven't named the hello port.
-->
It's already gave the name of Laboyant.
-->
Underscore far.
-->
Which I have no idea what's the meaning.
-->
But it's just given like weird name.
-->
So what you need to do.
-->
You need to put Docker.
-->
Sudo.
-->
Docker.
-->
RN.
-->
Sudo.
-->
Docker.
-->
RN.
-->
And that's it.
-->
Just press enter.
-->
Actually the demo name is not 0af.
-->
I'm not sure if you get that af.
-->
But can you download or remove that af?
-->
Yeah.
-->
Up there you can see the container ID.
-->
098 something.
-->
098.
-->
Control C is not working.
-->
You will get used to it soon.
-->
No no.
-->
P.
-->
Control shift V.
-->
Okay yeah.
-->
You can see now it's running.
-->
Now if I put.
-->
You put Sudo.
-->
Docker.
-->
Images.
-->
You can say hello world is there.
-->
You can put Sudo.
-->
Docker.
-->
RMI.
-->
And delete it.
-->
No problem.
-->
Done.
-->
Okay.
-->
Anyone.
-->
Any question.
-->
Okay.
-->
Now it's your idea.
-->
Okay.
-->
Let's go to our fight port.
-->
Okay.
-->
If you see I put port 8080.
-->
80.
-->
80.
-->
280.
-->
Which is a little bit confusing maybe for you guys.
-->
We have two ports here.
-->
Okay.
-->
Here if you remember from the beginning of my lecture.
-->
What did I say?
-->
I said that container are the.
-->
If you let me just rewind it more.
-->
I said that the containers are designed.
-->
To move the stuff around the globe.
-->
And the same concept come to our.
-->
Like come to the PC.
-->
So each container which you have right now.
-->
The container of let's say NGINX.
-->
Is fully isolated container.
-->
Just remember that ship.
-->
And that container are those containers on that ship.
-->
Now the virtual machine.
-->
Which is like now the desktop.
-->
For you guys the desktop is your virtual machine.
-->
Or like your local PC or any Google cloud.
-->
Look at that the desktop as that ship.
-->
Look at the NGINX as one of those containers on top of that ship.
-->
So for us outsiders we can just see the ships.
-->
We can we just see the ship.
-->
In the radar if they look at it is just a ship.
-->
The containers on top of these ships.
-->
So NGINX is inside this container not outside.
-->
For outside when you put Docker PS.
-->
You just see that there is a list of containers.
-->
You see in the ship when you look at the ship.
-->
You just see a ship and bunch of containers.
-->
You don't see inside them.
-->
But in computer we need to see inside them.
-->
We need to see inside the like containers.
-->
So how it's work.
-->
Just imagine that we make one hole in that containers.
-->
And we will look inside the container.
-->
What is it inside.
-->
So it's the same concept here.
-->
We need a port.
-->
NGINX by itself is port 80.
-->
Later on I will teach you.
-->
What is like the how to change the port 80 inside the NGINX container.
-->
Later on when we want to create our own image.
-->
Because right now we are working with the public image.
-->
But at the end of the day we're not going to work with the public image.
-->
So this 80 is a port which NGINX use to portray to outside.
-->
It's like that hole.
-->
So that hole is just in port 80.
-->
No other port can be come inside.
-->
But again this is a virtual machine.
-->
This is a virtual machine.
-->
So we need to yeah.
-->
We definitely have the terminal.
-->
And we have an access.
-->
We can see everything here.
-->
But what if someone is from outside wants to look at it.
-->
But if someone from the outside wants to look at it.
-->
So from outside we have to assign again a port.
-->
Which what did I do.
-->
I port 80 80.
-->
I put port 80 80.
-->
So what does it mean.
-->
It means that take port 80 from inside container.
-->
And connect it to port 80 80 outside container.
-->
So this is how entire vault can look at my container.
-->
So entire vault in the entire vault wide web can look at my container from the port 80 80.
-->
And NGINX by itself has a port 80 which is portrayed to the port 80 80.
-->
So NGINX has port 80 portrayed to port 80 80.
-->
And everybody from outside can see the port 80 80.
-->
Did you guys get it.
-->
OK.
-->
Obviously there is no question.
-->
I'm going to go back to my screen.
-->
OK.
-->
Here if you look.
-->
If I do sudo decker ps.
-->
You can see NGINX is running on port 80 80.
-->
HTTP run in port 80.
-->
Actually I'm not sure if the like this one.
-->
Give me enough networking permission.
-->
But if I put local house 80 80.
-->
Now you can see my NGINX is portrayed.
-->
Welcome to NGINX.
-->
If I just put local house and port just 80.
-->
Actually if you write port 80 it's automatically remove port 80 because port 80 is a standard protocol.
-->
And port 443 is for standard protocol for HTTPS.
-->
If I put this one.
-->
Local house is going to HTTPS.
-->
I'm going to just automatically go to HTTPS.
-->
So if I put.
-->
HTTP.
-->
Local.
-->
House.
-->
It's automatically jump into HTTP.
-->
So what I'm going to do.
-->
Let's go here.
-->
Let's remove this one sudo decker.
-->
RM-F.
-->
I'm going to remove front end.
-->
Front end.
-->
And I'm going to put sudo decker run dash dash name.
-->
Front end.
-->
In detach mode and dash p.
-->
I will give it 80 81.
-->
To the port 80.
-->
And it's going to be HTTP.
-->
OK.
-->
HTTP.
-->
So now if I go to the.
-->
Is it.
-->
If I go to the.
-->
Local house.
-->
And go port 80 81.
-->
You can see my Apache.
-->
It is my Apache HTTP.
-->
So this is how we because at the end of the day.
-->
Actually not all the duck cares all not containers later on I spoke speak.
-->
I'm going to speak about networking in the case because the care has the power of isolation.
-->
At the end of the day your main your main reason to run duck care.
-->
Is especially if you're working with the if you're a full set developer.
-->
Is to portray your app to the outside world.
-->
So either you're developing API.
-->
Which their website or like end user are fetching data from your API.
-->
Or you are using the like you are using your front a full set front end developer with your app is going to be accessed through the Internet.
-->
So no matter what are you doing you need to like somehow have a communication between the ports.
-->
To be able to like to be able to connect to each other to connect the containers to each other.
-->
Containers to each other or containers to outside world.
-->
So you can see this is port 80 81 and this is port 80 80s.
-->
OK you guys make like try it.
-->
Let me take a look and you guys make it try open your Firefox browser.
-->
You can see the Firefox logo is up there on your like bar.
-->
Don't don't go for port 80 port 80 is locked.
-->
It's reserved for HTTPS.
-->
That's the reason it's not going to work.
-->
But you can give any other port port.
-->
Instead of port 80 and 22 and 443 all other ports are open.
-->
For what.
-->
Sorry.
-->
OK I should have a better idea.
-->
Let's do yours.
-->
You want to run which one.
-->
HTTPS or nginx.
-->
How to.
-->
HTTPS.
-->
Can you first.
-->
I want to look what container you are running.
-->
Can you put conducts to the care.
-->
Yes I don't need to have it all but anyway.
-->
OK you can see your front end is now running.
-->
OK let's remove that one.
-->
Remove the extra one.
-->
What you can do.
-->
Put sudo dot care.
-->
RM and space dash F.
-->
Put it on the force mode because you want to delete everything.
-->
F.
-->
And now copy container IDs one by one.
-->
Put a space between each of them.
-->
You can use control shift C.
-->
Control shift V.
-->
Space.
-->
Just put a space.
-->
And go next one.
-->
You can delete multiple one.
-->
You already copied that.
-->
You already copied that.
-->
Go to the next one.
-->
OK.
-->
Press enter.
-->
OK.
-->
All of them deleted.
-->
Now if you put sudo dot care PS.
-->
You can see it's very clean and neat.
-->
Now we want to run it.
-->
Can you put sudo.
-->
Now let's go sudo dot care.
-->
And give it a name first.
-->
Dash dash name.
-->
Whatever name you would like.
-->
Name of your convenience.
-->
Now it's better to put it in detach mode.
-->
So you don't want.
-->
You want to continue using.
-->
OK.
-->
Now you need to give it a port.
-->
So to give it a port is dash P.
-->
Every command in dot care begin.
-->
Keep the detach mode.
-->
I'm not sure why you delete the detach mode.
-->
Keep it in detach mode.
-->
Yeah.
-->
Dash P.
-->
Every command in dot care usually begin with.
-->
Yeah.
-->
Dash 8080.
-->
And now finally you need to write.
-->
OK.
-->
What.
-->
Image do you want to use.
-->
Because you have list of images in your local machine.
-->
And you can even use.
-->
Yeah.
-->
HTTP.
-->
Yeah.
-->
OK.
-->
Sudo dot care.
-->
Run.
-->
You forgot run.
-->
Run.
-->
Yeah.
-->
OK.
-->
Done.
-->
Now you can open your.
-->
Like Firefox up there.
-->
88.
-->
Just forget the HTTPS.
-->
Just open a new tab.
-->
Because that's come with the HTTPS.
-->
With a new tab.
-->
Local house.
-->
No no no.
-->
Do not copy and paste.
-->
Just type it.
-->
Local house.
-->
Kale.
-->
88.
-->
You can see it's done.
-->
Anyone.
-->
It works.
-->
It works.
-->
What have you.
-->
LC.
-->
What's an LC.
-->
Mr.
-->
Leaching.
-->
Yeah.
-->
It works.
-->
What have you.
-->
Missed way.
-->
Let me check.
-->
Missed way.
-->
OK.
-->
It's running.
-->
Obviously it's running.
-->
Can you open your.
-->
Missed way.
-->
Can you open your Mozilla.
-->
Your Firefox.
-->
And check it.
-->
Sorry.
-->
I already deleted.
-->
So if you open it.
-->
It's not going to work.
-->
Because I can see you already.
-->
Oh actually.
-->
You scrolled up.
-->
Can you scroll down.
-->
Scroll down.
-->
Can you see what's the last.
-->
No.
-->
No no.
-->
The neon.
-->
OK.
-->
It's working now.
-->
Can you open your Firefox up there.
-->
And go to port 8080.
-->
See if it's working.
-->
Yeah.
-->
On the left side you can see there is a Firefox logo.
-->
Up there.
-->
Logo.
-->
Local house.
-->
Port 8080.
-->
No no no.
-->
No need to OSHQPS.
-->
Just put local house.
-->
8080.
-->
OK.
-->
Done.
-->
OK guys.
-->
It's 11 o'clock.
-->
We need to have a cup of coffee.
-->
So let's have a 10 minute break.
-->
So after 10 minutes I'm going to come back and we're going to go with the concept
-->
of volume and environmental variable and so much more.
-->
So just take a break and see you in 10 minutes.