0% found this document useful (0 votes)
14 views

Docker Interview - FAQs & Answers

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Docker Interview - FAQs & Answers

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Docker Interview Questions and Answers

1. What is Hypervisor?

A hypervisor is a software that makes virtualization possible. It is also called Virtual


Machine Monitor. It divides the host system and allocates the resources to each divided

an
virtual environment.

2. What is virtualization?

m
Virtualization is the process of creating a software-based, virtual version of something
(compute storage, servers, application, etc.). These virtual versions or environments are
eh
created from a single physical hardware system.

3. What is containerization?
Let me explain this is with an example. Usually, in the software development process,
R
code developed on one machine might not work perfectly fine on any other machine
because of the dependencies. This problem was solved by the containerization concept.
l

So basically, an application that is being developed and deployed is bundled and


du

wrapped together with all its configuration files and dependencies. This bundle is called
a container. Now when you wish to run the application on another system, the container
is deployed which will give a bug-free environment as all the dependencies and libraries
Ab

are wrapped together. Most famous containerization environments are Docker and
Kubernetes.
4. Difference between virtualization and containerization

Once you’ve explained containerization and virtualization, the next expected question
would be differences. The question could either be differences between virtualization
and containerization or differences between virtual machines and containers. Either
way, this is how you respond.

Containers provide an isolated environment for running the application. The entire user

an
space is explicitly dedicated to the application. Any changes made inside the container
is never reflected on the host or even other containers running on the same host.

m
Containers are an abstraction of the application layer. Each container is a different
application.
eh
Whereas in Virtualization, hypervisors provide an entire virtual machine to the
guest(including Kernal). Virtual machines are an abstraction of the hardware layer. Each
VM is a physical machine.
R
5. What is Docker?
l

Docker is an open source containerization platform which packages your application


du

and all its dependencies together in the form of containers so as to ensure that your
application works seamlessly in any environment, be it development, test or production.
Ab

6. What is a Docker Container?


Docker containers include the application and all of its dependencies. It shares the
kernel with other containers, running as isolated processes in user space on the host
operating system. Docker containers are not tied to any specific infrastructure: they run
on any computer, on any infrastructure, and in any cloud. Docker containers are
basically runtime instances of Docker images.
7. What are Docker Images?
When you mention Docker images, your very next question will be “what are Docker
images”.

Docker image is the source of Docker container. In other words, Docker images are
used to create containers. When a user runs a Docker image, an instance of a container
is created. These docker images can be deployed to any Docker environmen

an
8. What is Docker Hub?
Docker images create docker containers. There has to be a registry where these docker
images live. This registry is Docker Hub. Users can pick up images from Docker Hub

m
and use them to create customized images and containers. Currently, the Docker Hub is
the world’s largest public repository of image containers.
eh
9. Explain Docker Architecture?
Docker Architecture consists of a Docker Engine which is a client-server application with
R
three major components:

1. A server which is a type of long-running program called a daemon process (the


docker command).
l

2. A REST API which specifies interfaces that programs can use to talk to the
du

daemon and instruct it what to do.


3. A command line interface (CLI) client (the docker command).
4. The CLI uses the Docker REST API to control or interact with the Docker
daemon through scripting or direct CLI commands. Many other Docker
Ab

applications use the underlying API and CLI.


10. What is a Dockerfile?
Let’s start by giving a small explanation of Dockerfile and proceed by giving examples
and commands to support your arguments.

Docker can build images automatically by reading the instructions from a file called
Dockerfile. A Dockerfile is a text document that contains all the commands a user could
call on the command line to assemble an image. Using docker build, users can create

an
an automated build that executes several command-line instructions in succession

11. Tell us something about Docker Compose.


Docker Compose is a YAML file which contains details about the services, networks,

m
and volumes for setting up the Docker application. So, you can use Docker Compose to
create separate containers, host them and get them to communicate with each other.
eh
Each container will expose a port for communicating with other containers.

14. What is the lifecycle of a Docker Container?


R
This is one of the most popular questions asked in Docker interviews. Docker
containers have the following lifecycle:
l

● Create a container
du

● Run the container


● Pause the container(optional)
● Un-pause the container(optional)
● Start the container
Ab

● Stop the container


● Restart the container
● Kill the container
● Destroy the container

You might also like