API

Annie, a cloud security engineer, uses the Docker architecture to employ a client/server model in the application she is working on. She utilizes a component that can process API requests and handle various Docker objects, such as containers, volumes, images, and networks. What is the component of the Docker architecture used by Annie in the above scenario?

Annie, a cloud security engineer, uses the Docker architecture to employ a client/server model in the application she is working on. She utilizes a component that can process API  requests and handle various Docker objects, such as containers, volumes, images, and networks. What is the component of the Docker architecture used by Annie in the above scenario?

Option 1 : Docker daemon
Option 2 : Docker client
Option 3 : Docker objects
Option 4 :  Docker registries

1. Docker daemon

Docker uses a client-server design. The docker client talks to the docker daemon, that will the work of building, running, and distributing your docker containers. The docker client and daemon will run on the same system, otherwise you will connect a docker consumer to a remote docker daemon. The docker consumer and daemon communicate using a REST API, over OS sockets or a network interface.

The docker daemon (dockerd) listens for docker API requests and manages docker objects like pictures, containers, networks, and volumes. A daemon may communicate with other daemons to manage docker services.

2. Docker client

The docker client (docker) is that the primary method that many docker users act with docker. once you use commands like docker run, the client sends these commands to dockerd, that carries them out. The docker command uses the docker API. The docker client will communicate with more than one daemon.

3. Docker objects

When you use docker, you’re making and using pictures, containers, networks, volumes, plugins, and alternative objects. This section could be a brief summary of some of those objects.

IMAGES

An image is a read-only template with instructions for making a docker container. Often, a picture relies on another image, with some further customization. for instance, you’ll build a picture that relies on the ubuntu image, however installs the Apache internet server and your application, still because the configuration details required to create your application run.

You may produce your own pictures otherwise you might solely use those created by others and printed in a registry. to create your own image, you produce a Dockerfile with a simple syntax for defining the steps needed to make the image and run it. every instruction in a Dockerfile creates a layer within the image. once you change the Dockerfile and rebuild the image, solely those layers that have modified square measure remodeled. this is often a part of what makes pictures therefore light-weight, small, and fast, when put next to alternative virtualization technologies.

CONTAINERS

A instrumentality could be a runnable instance of a picture. you’ll produce, start, stop, move, or delete a instrumentality victimization the docker API or user interface. you’ll connect a instrumentality to at least one or a lot of networks, attach storage to that, or perhaps produce a brand new image supported its current state.

By default, a container is relatively well isolated from alternative containers and its host machine. you’ll management however isolated a container’s network, storage, or alternative underlying subsystems square measure from alternative containers or from the host machine.

A instrumentality is outlined by its image still as any configuration choices you offer to that once you produce or begin it. once a instrumentality is removed, any changes to its state that aren’t hold on in persistent storage disappear.

Example docker run command

The following command runs an ubuntu container, attaches interactively to your native command-line session, and runs /bin/bash.

$ docker run -i -t ubuntu /bin/bash

When you run this command, the subsequent happens (assuming you’re victimization the default written account configuration):

  1. If you are doing not have the ubuntu image locally, docker pulls it from your designed registry, like you had run docker pull ubuntu manually.
  2. docker creates a new container, like you had run a docker container create command manually.
  3. docker allocates a read-write filesystem to the container, as its final layer. this permits a running container to make or modify files and directories in its native filesystem.
  4. dock-walloper creates a network interface to attach the docker to the default network, since you did not specify any networking choices. This includes assigning an IP address to the instrumentality. By default, containers will connect with external networks victimization the host machine’s network connection.
  5. docker starts the container and executes /bin/bash. as a result of the container is running interactively and connected to your terminal (due to the -i and -t flags), you’ll offer input using your keyboard whereas the output is logged to your terminal.
  6. when you type exit to terminate the /bin/bash command, the container stops however isn’t removed. you’ll begin it once more or take away it.
SERVICES

Services permit you to scale containers across multiple docker daemons, that all work along as a swarm with multiple managers and employees. every member of a swarm could be a docker daemon, and every one the daemons communicate victimization the docker API. A service permits you to outline the desired state, like the quantity of replicas of the service that has to be offered at any given time. By default, the service is load-balanced across all employee nodes. To the consumer, the docker API service seems to be one application. docker Engine supports swarm mode in docker one.12 and better.

4. Docker registries

A docker registry stores docker pictures. docker Hub could be a public registry that anyone will use, and docker is designed to seem for pictures on docker Hub by default. you’ll even run your own private registry.

When you use the docker pull or docker run commands, the required pictures are force from your designed registry. once you use the docker push command, your image is pushed to your designed registry.

Learn CEH & Think like hacker


This Blog Article is posted by

Infosavvy, 2nd Floor, Sai Niketan, Chandavalkar Road Opp. Gora Gandhi Hotel, Above Jumbo King, beside Speakwell Institute, Borivali West, Mumbai, Maharashtra 400092

Contact us – www.info-savvy.com

https://g.co/kgs/ttqPpZ

Leave a Comment