Open JayCesar opened 3 months ago
Docker is a virtualization software that makes developing and deploying applications much easier.
It works by packeging an application with all the necessary dependencies, configuration, system tools and runtime.
- So it is a standardized unit, that has everything the application needs to run.
It becomes a portable artifact easily shared and distributed.
So how container solve theses problems?
Solution:
There are two main layers (SO and Kernel). Kernel talks to Hardware and SO are the applications. Linux Applications talk to the Linux kernel and Windows applications talk to the WIndoes kernel
It virtualizes the complete operating system and boots up its host.
Docker images are smaller than VM images
Important note: Docker works only with Linux Distro while VM with all OS's. This is the main difference between Docker and VM (Compatibility).
It means I can not run Linux bases images over Windows kernel, because I can not run Linux application layer in Windows kernel.
But later on, running Linux images in windows became possible but only using docker desktop. (Hypervison layer).
An executable artifact in software development and deployment (including Docker) is a file or set of files** that can be directly run or executed to perform a specific task or start an application.
And when I run this image, I mean, this executable application artifact, I have a running instance of this image, which is called Container. Run an image? I create a container.
So, I can run multiple containers from 1 single image:
docker images = list docker images docker ps = list docker containers
How do we get images? Using docker registries:
Docker Hub is where I find images from a lot of services!
So images are versionated!
DockerHub Registry is the default location when I try to pull an image.
If I do not specify the tag, It will download the latest by default too.
I can run an image by using these command:
docker run {image}:{tag}
Then a container (with a random name) will be launched, but I will be 'inside' the container. So to exit I just run the command "exit"
I can run the command in background using "d" of "detach":
docker run -d {image}:{tag}
to see the logs:
docker logs {container}
Obs: I can run the images without running the command docker pull image
Overview