Friday, June 2, 2023

DOCKER ENGINE ,DOCKER DAEMON


 



DOCKER ENGINE

We will take a look at docker architecture. And how it runs application in isolated container. Each time you install docker on a Linux machine, you're installing three different component Docker CLI, REST API, Docker Daemon. Docker Engine is an open source containerization technology for building and containerizing applications.

DOCKER DEAMON: 

Is the background processes that manages docker object like images, network, volumes, container.

REST API: 

This is the interface program that interact with docker daemon through CLI. You can create your tools using this API.

DOCKER CLI:

This is the command line interface. It uses the REST API to interact with the docker daemon.



DOCKER ARCHITECTURE

Docker uses a client-server architecture. There's an interaction between docker client and docker daemon which helps with building, running and distribution of your docker containers, For the communication to be seamless there's a REST API, over UNIX sockets or network interface that brings all together. 



DOCKER REGISTRY

If you have an idea how github repository works, then docker register in this case, stores Docker images. Docker hub is a public registry that anyone can use and you can configure and look for images on docker hub by default. You can as well own a private registry. With the command  docker pull, docker run helps you to fetch the images from the registry. The command docker push helps you to push what you configured to your registry. 

HOW DOES APPLICATION WORKS UNDER THE HOST: 

Docker uses namespace to provide the isolated workspace called the container, like process ID, network, interprocess communication, mount. When you run a container, docker creates a set of namespaces for that container. 




Process ID: You start a Linux O/S, it starts with one process ID which is the root process which kicks off other processes ID in the system . 
The command "docker ps" to list all the running processes. The process ID are unique and you cannot have the same process ID. 

Container: You create a container you have a another process ID created at the base linux system, on the host from an existing process ID, in this case process ID namespace is created in which the process ID within container is functioning independently.You can list the service on a docker container, and you'll see process ID of the container. That means all service are running on the same host but separated into containers using namespaces. 

Cgroups: Control group is a linux kernel feature that limits and isolates resource usage (CPU, memory, disk, network). By default there's no restriction as to how many resources can be use in a container however, a container may use all the resources within the host. In order to restrict the amount of CPU or memory, docker uses  Cgroup to control the amount of resources in a container. You can run the command "docker run --memory=200m ubuntu". You limit the amount of memory.
 





Referencing: docker documentation 
                     https://docs.docker.com/engine/
                    Kodekloud


No comments:

Post a Comment

CONFIGURING A PHISHING CAMPAIGN IN MICROSOFT DEFENDER.

Configuring a phishing campaign in Microsoft Defender (specifically Microsoft Defender for Office 365) involves creating a simulated attack ...