Docker Interview Question


What is a docker ?

It is a command line program that simplifies installing , running and publishing software. It is done by unix technology called container.Softwares are run with docker inside container.Docker package , ship and run software.It is not programming language. it is tool that helps to install, upgrade , remove and manage software.It uses Linux container technology.

What type virtualization does docker use ,hardware or software ?


How each container is isolated to other container ?

There are many aspects

  • PID : Process Identifier
  • USR : User name
  • NET : Network access
  • UTS : Host name

What is docker image ?

It is a bundled of all the files that are required to run application running inside a container,For example to run an java program we require OS ,JDK etc. From image any number of containers can be created and they are isolated.

What are some docker features ?

Docker has many features that justify its usage
  • Isolation:Docker uses container concept, due to which every application can be deployed in separate container and as we learned that every container is in isolation with other container.
  • Security:As application is deployed inside container so even application has bug or attacker application, its scope is limited to container.By this way one application can not harm to others
  • Scalable:Containers are lightweight so they can easily scaled.
  • Portability:Docker application can easily be moved from one OS to other..

What is the docker hub ?

It is a public registry provided by docker Inc.It is a default registry.If we execute any docker pull without mentioning registry then docker searches repository in docker hub by default.

What does it mean by detached container ?

It means that container will run in background.

How docker can resolve conflict problem for example running many server on same port ?

In docker we can run server on different container, as they are isolated so conflict solves .

What are docker states ?

Docker has four states

  • Running
  • Paused
  • Restarted
  • Exited

What is repository in docker ?

In docker repository is a bucket of images.Every image has unique tag.For example if a software has two version then it's images will have two tag.Repository and tag form composite primary key.

What is the volume in docker ?

Volume is a tool that shares data across containers,so its scope is not limited to single container.It uses modularity concept so it can easily be reused.Images hold static data while volumes holds dynamic data.

Using volumes we can inject different behavior for example our image is using database. Database has same interface but with changing data we can inject different behavior to container.

To understand with example in details
Docker Volume Example

What are the types of volume ?

There are two types

  • Bind mount:It uses user defined file to get location.
  • Managed mount:It uses docker daemon controlled location.

How many ways to share volumes among containers ?

There are two types

  • Host Dependent Sharing
  • Generalized Sharing

What is host dependent sharing ?

In host dependent sharing same host location is mounted by more than one container's bind volume.

What is Generalized sharing ?

In generalized sharing we can copy volume definition from one or more container to new container. Docker provides one flag --volumes-from that tells from which container you want to copy volume.

What does it mean by orphan volume ?

In managed volume, container reference the volume managed by docker if we delete container with -v option then it deletes mapped volume as well but if we fail to use -v option then after deleting every container managed volumes do not delete and managed volume is called orphan and should be deleted manual script.

Visit Others Links

Interview Questions Top Elasticsearch Interview Question
Top Kubernetes Interview Question
Top HTTP Interview Question
Top PouchDB Interview Question
Top Pivotal Cloud Foundry (pcf) Interview Question
Top Apache Camel Interview Question
Top Docker Interview Question
Top Gradle Interview Question
Top Generics Interview Questions In Java
Java 9 Interview Questions
Top Maven Interview Question
Top RabbitMQ Interview Question
Top Spring Batch Interview Question
Top Spring Boot Interview Question
Top Tika Interview Question
Top Kotlin Interview Question
Top OpenShift Interview Question
Top Polymer Interview Question
Top WebGL Interview Question
Top Continuous Integration Interview Question
Top Spring Cloud Interview Question
Top JOGL Interview Question
Top JFreeChart Interview Question
Java MultiThreading Interview Question
Top Spring ROO Interview Question
Top Seaborn Interview Question
Top TestRail Interview Question
Top LolCode Interview Question
Top Spring Transaction Management Interview Question
Top DynamoDB Interview Question
Top PySpark Interview Question
Top SaltStack Interview Question
Top Spring AOP Interview Question
© 2019