Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

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

Answer»
  • The command used to get all version INFORMATION of the CLIENT and SERVER is the docker version.
  • To get only the server version details, we can run docker version --format '{{.Server.Version}}'
2.

Can a paused container be removed from Docker?

Answer»

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

3.

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

Answer»

This can be done using the DOCKER load command and the syntax is docker load -i <export_image_name>.TAR

4.

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

Answer»

This can be DONE USING the DOCKER save command and the SYNTAX is: docker save -o <exported_name>.tar <container-name>

5.

What is a Docker Hub?

Answer»
  • It is a PUBLIC cloud-based registry provided by Docker for storing public images of the CONTAINERS along with the PROVISION of finding and SHARING them.
  • The images can be pushed to Docker Hub through the docker push COMMAND.
6.

How many Docker components are there?

Answer»

There are three docker components, they are - Docker Client, Docker Host, and Docker Registry.

  • Docker Client: This component performs “build” and “run” OPERATIONS for the purpose of opening communication with the docker host.
  • Docker Host: This component has the main docker daemon and hosts containers and their ASSOCIATED images. The daemon ESTABLISHES a connection with the docker registry.
  • Docker Registry: This component stores the docker images. There can be a public registry or a PRIVATE one. The most famous public registries are Docker Hub and Docker Cloud.
7.

What is docker image registry?

Answer»
  • A Docker image registry, in simple terms, is an area where the docker IMAGES are STORED. Instead of converting the applications to containers each and every time, a DEVELOPER can directly use the images stored in the registry.
  • This image registry can either be public or private and Docker hub is the most POPULAR and famous public registry available.
8.

On what circumstances will you lose data stored in a container?

Answer»

The DATA of a CONTAINER REMAINS in it until and UNLESS you DELETE the container.

9.

What is the docker command that lists the status of all docker containers?

Answer»

In ORDER to get the status of all the CONTAINERS, we RUN the below command: DOCKER ps -a

10.

Can you tell something about docker namespace?

Answer»

A namespace is basically a Linux feature that ensures OS resources partition in a mutually EXCLUSIVE manner. This forms the core concept BEHIND containerization as namespaces introduce a layer of isolation AMONGST the containers. In docker, the namespaces ensure that the containers are portable and they don't affect the underlying HOST. Examples for namespace types that are currently being supported by Docker – PID, Mount, USER, Network, IPC.

11.

What can you tell about Docker Compose?

Answer»

It is a YAML file consisting of all the details regarding various services, networks, and volumes that are needed for setting up the Docker-based application. So, docker-compose is used for CREATING multiple CONTAINERS, HOST them and establish communication between them. For the purpose of communication amongst the containers, ports are exposed by each and every CONTAINER.

12.

Can you tell what is the functionality of a hypervisor?

Answer»

A hypervisor is a software that makes virtualization happen because of which is sometimes referred to as the Virtual Machine MONITOR. This divides the resources of the HOST system and allocates them to each guest environment installed.

  • This means that multiple OS can be installed on a single host system. Hypervisors are of 2 types:

    1. Native Hypervisor: This type is also called a Bare-metal Hypervisor and RUNS directly on the underlying host system which also ensures direct ACCESS to the host hardware which is why it does not require base OS.
    2. Hosted Hypervisor: This type makes use of the underlying host OPERATING system which has the existing OS installed.
13.

What is a DockerFile?

Answer»
  • It is a TEXT file that has all commands which need to be RUN for building a GIVEN IMAGE.
14.

What are docker images?

Answer»

They are executable packages(bundled with application code & dependencies, SOFTWARE packages, etc.) for the purpose of creating containers. DOCKER images can be deployed to any docker environment and the containers can be spun up there to RUN the application.

15.

Can you tell something about docker container?

Answer»
  • In simplest terms, docker containers consist of applications and all their dependencies.
  • They share the KERNEL and system resources with other containers and RUN as isolated systems in the host operating system.
  • The MAIN aim of docker containers is to get rid of the infrastructure dependency while DEPLOYING and running applications. This MEANS that any containerized application can run on any platform irrespective of the infrastructure being used beneath.
  • Technically, they are just the runtime instances of docker images.