O mínimo que você precisa saber sobre Docker!

261.25k views2566 WordsCopy TextShare
Diolinux
✅ Conheça a https://hostinger.com.br/diolinux e use o cupom "diolinux" para ter mais 7% de desconto....
Video Transcript:
docker is one of today's main technologies behind several internet services that you use every day, probably including our own forum if you do n't know it, stop by then we've already done several projects here on the channel that involve docker But I noticed in the comments that a lot of people, no matter how much they've heard about docker, don't really know the basics about the tool to really take advantage of the benefits it can bring So this video here will help you with the least you need know about docker to start creating some labs and
playing with this technology so amazing we want this content for you with the support of hosting a website hosting company that allows you to have servers to run your own docker containers professionally if you want they have several different hosting models in fact we host the Linux blog there using Wor dPress so maybe you can enjoy it too I really like the Andy pennel they have to manage the servers it's one of the easiest panels I've ever found in all the hosting I've tested you can go to hosting.com.br/jolinux for to know more and to receive
a nice discount on plans that are already very cheap, let's face it Just put the olinox coupon when closing your purchase guys I'll be straight here with you I'll show you a lot in practice but before that we need to understand some things that are a little more theoretical but that are the foundation of all this wonderful technology called docker but don't worry I'll explain it in a simple way so you can understand and then you see sense and use container for the things that you do, you must have heard of virtual machines or vms,
right there are some very popular programs that are used for this in domestic environments, even like VirtualBox or vmware and if you You use Mac You've probably heard of Paralelos, there's a video about all these here on the channel in case you don't already know The great thing about virtual machines is that you can run an operational cistão inside the other without them having a direct interaction, necessarily allowing you to test things we arrived that you have 8 GB of Ram and a processor of four cores you can create a VM there with a system
that will use 4G of Ram and two cores of the processor dividing the resources of the fast to make two applications run at the same time on two different systems is pretty cool right This can scale Even more if you have a stronger computer with more ram with more processor, right the beefier processor with more storage also in an Enterprise scope this is how VPS are born virtual privates servers as we have already explained here on the channel, there is also a very clear benefit in you virtualizing systems so you can transform a computer into
several right Each one running are fully operational different from the other for example Despite these benefits it didn't take long for the market to also realize a problem in some cases running a complete virtualized temporal is kind of waste especially if the intention is to run only one application for example like wordpass in these cases you would have two complete environments two complete systems with two canyons you have to take care of the security of both systems it uses more processor and RAM resources and storage than would be necessary if you only ran the application
And that's where the idea of ​​software is born in containers That's where technologies like olxc and docker come in Both are very popular but docker ended up standing out over time Unlike what happens with a virtual machine, a docker container can share resources from the Host machine itself As the Kernel itself avoids redundancy by reducing the use of unnecessary resources and how containers can be isolated from each other you get a nice security book too at the same time you can make a machine run several different applications simultaneously without spending so much resource on wrong
optimization Total it's not hard to understand why something like this was so successful at the Enterprise level because another cool thing that the containers allow is that you have relatively simple backups in a way and you can configure several things and leave pre-ready services to run facilitating scalability and reducing the team of various services Look what a cool example some weeks I showed you here on the channel the couple S remembers this video a platform that allows you to run a server in your house with several applications for you to have services such as plexus
father or next Cloud very accessible way to want the magic behind that project each of these applications is a container an isolated box running on top of an operating system ional complete imagine a situation like this with virtual machines where I want to isolate these applications and run each one in a virtual machine I would have a base system and a complete virtualized operating system to run each of the applications having to maintain each one of them and sharing hardware with each of them nothing very practical and not economical right docker solves this with a
certain ease a beautiful level of efficiency is something so popular that it is maybe even easier to point someone who doesn't use docker nowadays than someone who does if you are developer Or are you thinking about working with Devotees or want to be a system administrator is a knowledge that you should definitely put on your resume with a Skill and honestly even for you who have some simple servers in your house and I like to play with this one kind of thing docker is a nice thing to know Docker is usually used with applications on
servers with no interface but it is so versatile useful that you can even do some crazy things like the casmurfspaces that we showed here on the channel where you can stream apps via docker with a crazy interface I think you already understand that docker is really cool So how about we create a Lab here for you to take your first steps Technically docker runs on Windows and Mac OS too so you can do it on any system but its home is a Linux if you have a Linux distro on your desktop you can already start
play with docker No problem at all my personal preference is to create a virtual machine or have a separate server to do this as Ubuntu is used to install docker on it so I separate my test environment a little from my production machine but the choice is yours if you decide to create an ubuntuser stay tuned because the world server installation process itself allows you to install docker already directly if you want but here I'll assume you don't have f That's it and we're going to do the process from the beginning the point serves it's
kind of a reference in that it's one of the most popular base systems to build servers on the internet but docker can run on any destroying if you use any difference from Ubuntu base gives check your system documentation to see what commands you can use to do the installation process on the ponto server we can use the command sudo APT install docker.io space docker dash composed and where docker.io is actually the basics to run docker and composed it there, it's for you to climb with penis using dockerfiles But don't worry about that now just to
make the installation more complete even after installing docker we need to make it start together with the system and also is enabled for our use for us to do this without having to restart the server you can use the command sudo enable space less less no docker space docker socket space container de and with docker already running you will be able to run the command docker space minus minus help for you to see the help menu with the main commands that it has this menu there will be useful in the future so read all this
calmly and that's it folks, you saw how easy you already have docker running and you can install applications via containers we can do something really cool here for you to start using some basic docker features so you learn in practice and do something cool at the same time, right? one of the coolest things we have in the docker universe is the docker Hub a community repository with images and applications even operating systems you can find here all kinds running in containers and we can pull these images from docker HUB to create our projects if you
are familiar there with flashback Snap in the world of desktop Linux especially you can see where the inspiration comes from these technologies of empaco software moment of latest in technologies of control tainers like docker returning here the terminal we will create a local instance of WordPress so you can test things on ICMS before running and on your real server or even create a development environment for you who want to test themes and plugins and things like that first we will log in as root here in the terminal and then we will simply type docker pull
WordPress This command there will download a WordPress image from the docker HUB if you do not specify a version This command will always try to download the last image the most recent image or test Law as you can see on the site but stay tuned what we downloaded here was a WordPress image this image can be used to create several different WordPress servers several dockers several different containers is a base image for building something and you can have several images available to create as much container as you want if you use the docker images command
you can see the available images here it is and as you can see there is our beautiful WordPress with various information such as the unique ID of the Image and its size too WordPress is Technically an application directly that we have already pulled but there are distros that you can download to use in some project or use as a base to run something if you give Ubuntu a docker Pool we will get the most recent version of the canonical system which is basically the most simplified ubuntu's server there to run Ubuntu inside a container together
with All Pine that we showed in another recent video here on the channel are two of the most popular distros of docker HUB with more than 1 billion downloads billion there with impressive B right if we use the docker images command again now we will see that we we have two images available, one from Ubuntu, the other from wordpass, a container in practice is an image of these running and for us to create a container based on an image like the one in WordPr ess that we have already pulled we can run a command so
we have the command to run the container in front we specify the name for this container then we specify a port for the service to run and then we specify which image we are going to run Through this port right What is the image that will serve as the basis for this container after we did this the container is already running and we have a new command here for you to learn docker space PS This command lists the running containers and as well the docker images command This command also shows the ID of the container
and this information can be useful to manipulate the container itself as you will see in a little while another important information to observe here whenever we are talking about web services especially as is the case here for WordPress is the port that the server is using in this case is the 8080 that we defined in the creation of the container This means that if you type r the IP address of the server in your browser or even the local host right if you are when it is directly on your machine with the indicated port you
will be able to access our WordPress Instance so you can work and test Everything you want now for you to understand some of the other commands and ways of interacting with docker Let's create an ubuntu's server via docker here with the Ubuntu image that we downloaded before we can use the docker command Run then give it less space and space again with the image name in this case Ubuntu now let's learn how to remove your containers if you want to delete some of them you can use the docker PS command but put the minus a
parameter at the end to show all the containers that are running and stopped There by the status clone you you can see that the containers that are running with status of Up and the ones that exist but are not running are with different status in this case here are containers that are running cannot be removed like that so we need to stop them first with Cris top command And then the name of the container or it and taking advantage of the tip is until Obvious I think if the stop for the container the start starts
the container and the Restart restarts- if container with stopped container you can remove it with docker RM and the container ID but the images are still there right if you want to remove an image the command actually looks like docker rmi and the image name like Ubuntu for example you can use an image to create several different containers Some will be running others not if any container is using this image You will need to remove the containers first and then remove the image or else you can force this removal But this can eventually cause some
problems and some situations so I'm alert I prefer to remove the images only when nothing is using them what you saw today how to install containers how to download these images r them and put some images to run How to remove is probably less than the tip of the do iceberg but I think it's a nice point worth it Initial I'll leave here in the description some links to the doc documentation for you to explore a little more If you're interested in this, at least you have an idea of ​​how this world of containers works
and you won't be completely lost when someone talks about it if you want to put some of this knowledge you learned today into practice here are some video suggestions where we used docker you can check it out i'll see you in the next video and if this video helped you remember to share to more people leave a like there until next time said
Copyright © 2024. Made with ♥ in London by YTScribe.com