Docker Flashcards

1
Q

What is Docker

A

Docker is a powerful open-source containerization platform
that is used for building, deploying, and running applications.

Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.

We can say Docker is a container management service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Image in Docker

A

Image is a read-only templet with combination of instructions as file system and parameters used for creating a Docker container

sometimes referred to as snapshots
you may build an image which is based on the exist image like SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Container in Docker

A

A container is a runnable instance of an image

A container packages up code and all its dependencies, libraries and configuration so the application runs quickly and reliably from one computing environment to another

you can create, start, stop, move or delete a container using the Docker API or CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Registry (hub)

A

It is a public cloud-based registry provided by Docker for storing public images of the containers that anyone can use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Client in Docker

A

The Docker Client is the primary way that users interact with Docker

When you use commands such as docker run the client sends these commands to Docker which carries them out the docker command uses the Docker API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Docker Daemon

A

The Docker daemon is a service that runs on your host operating system listens for Docker API requests and managers Docker objects such as images, containers, networks, and volumes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Name Spaces

A

Is a technology called namespaces to provide the isolated workspace called the container when you run the container
Docker create a set of namespaces for that container
These namespaces provide a layer of isolation
Each aspect of a container runs in a separate namespace and its access is limited to that namespace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A

An application running in a container is isolated from the rest of the system and from other container but gives the illusion of running in its own OS instance

multiple Docker container can be run on the single operating system simultaneously you can manage those containers with Docker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Virtualization

A

Virtualization is technology that lets you create useful IT services it use a physical machine’s to distributing its capabilities among many users or environments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Advantage of Containerization

A
  • Portability: Think write once run anywhere
  • Lightweight: shares the host operating system’s kernel
  • Scalable: be scaled up quickly
  • Start up: in milliseconds
  • Multiple containers :
  • Simple and fast deployment :
  • Secure : Isolation and Virtualization keep apps more secure
  • Flexible and Loosely Coupled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Rest API

A

These are the underlying commands used by the CLI and other applications to interact with the Docker Daemon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Docker objects

A

Docker objects are the building blocks that are managed by the docker daemon.
The most fundamental docker objects are images and containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Docker file

A

It is a text file that has all commands which need to be run for building a given image.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Docker Volumes

A

Volumes are a way to persist data for a container.
instead to use copy command we use Volume mapping

Volumes are managed using the CLI and the Docker API.

  • sharing data between many different containers
  • Separate container from storage
  • on deleting container volume does not delete

Volumes are also helpful because they allow Docker to keep the containers slim by saving data in the volume rather than the writable layer that disappears with the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Docker compose = YAML file

A

The docker-compose file (YAML file) allows you to run multiple containers in an easy way
Moreover it makes it easy to set up those containers to talk to one another.
It’s a YAML file(.yaml or .yml) that includes key information including environment variables, ports, volumes etc.

Docker compose is the tool that makes creating and managing multi-container applications easier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Building an Image

A

An image will typically be built from a docker file, though it can be built from a container that’s already running and has been modified.
The former is preferred, but the latter can be helpful in a development environment.

17
Q

What is the functionality of a hypervisor?

A

A hypervisor is a software that makes virtualization happen

Hypervisors are of 2 types

  1. Native Hypervisor: which does not require base OS.
  2. Hosted Hypervisor: which has the existing OS installed.
18
Q

What command can you run to export a docker image as an archive?

A

docker save -o .tar

19
Q

What command can be run to import a pre-exported Docker image into another Docker host?

A

docker load -i .tar

20
Q

Can a paused container be removed from Docker?

A

No, it is not possible! A container MUST be in the stopped state before we can remove it.

21
Q

What command is used to check for the version of docker?

A

docker -v

22
Q

Differentiate between virtualization and containerization

A

Virtualization
1- Each VM runs its own OS
2- Boot up times in minutes
3- It used Hypervisor to separate the physical machine
4- it is not portable
5- it has hardware level isolation
6- cannot run more than couple of VMs on an average laptop
7- not version controlled
8- only one VM can started from one set of VMX and VMDK files
——————————————————————————————————————–
Containerization
1- ALL Containers Share the same Kernel of the host
2- Container instantiate in milliseconds
3- It used docker engine in case Docker
4- it is very portable. We can build, ship and run anywhere
5- It has process level isolation
6- can run many Container in laptop
7- Can be version controlled (DockerHub like GitHub)
8- Multiple Docker containers can be started from one image

23
Q

What is containerization

A

Docker is the containerization platform which is used to package your application and all its dependencies together in the form of containers so to make sure that your application works easy in any environment which can be development or test or production.

24
Q

NGINX

A

NGINX is a popular lightweight web application that is used for developing server-side applications.

It is an open-source web server that is developed to run on a variety of operating systems.

Since nginx is a popular web server for development, Docker has ensured that it has support for nginx.

25
Q

command creates nginx container

A
# docker run --name mynginx1 -p 80:80 -d nginx
This command creates a container named mynginx1 based on the NGINX image.