Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions C++ Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions F# Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions

Top 12 Docker Interview Questions for 2020

Most frequently asked Docker Interview Questions and Answers for Fresher

1. What is Docker?

Docker is a new form of Software Containerization in the field of IT. It is an open-source container service designed to facilitate applications deployment inside the software containers. It relies on Linux Kernel Features such as namespaces and cgroups ensuring that resource isolation and application packaging along with its dependencies. Docker was licensed under Apache License 2.0 in the binary form and wholly written in the Go programming language. It supports several operating systems such as Linux, Cloud, Windows, and Mac OS and different platforms such as ARM architecture and x86-64 windows platforms.

2. Why use Docker?

  • A user can quickly build, ship, and run its applications.
  • A single operating system kernel runs all containers.
  • Docker container is more light-weight than the virtual machines.
  • A user can deploy Docker containers anywhere, on any physical and virtual machines and even on the cloud.

3. What are the components of Docker Architecture?

Docker Client (docker ) enables a user for Docker interaction. It can communicate with more than one Docker Daemon.  It uses Docker API and sends command ( docker run)  to Docker Daemon ( dockerd ) which carries them out. Docker Daemon ( dockerd )  gives a complete environment to execute and run applications. It consists of images, containers, volumes and responsible for all container-related actions. It pulls and creates the container images as what the client requests. A Daemon can communicate with other daemons for its service management. Docker registry is versioning, storage, and distribution system for Docker images. It allows Docker users to pull images locally, as well as push new images to the registry. Docker Hub is a public registry instance of Docker used by default while installing Docker Engine. Docker Image is a lightweight, standalone, executable package of Docker stored in a Docker Registry.  It is used to create a container.  It consists of everything needed to run an application- code, a runtime, system libraries, system tools, environment variables, configuring files, and settings. Docker Container is a standardized unit of software used to deploy a particular application or environment. It launched by running an image. It packages up code and all of its dependencies so that apps can run quickly and reliably from one computing environment to another.

4. On what platforms does Docker run?

Docker runs on various platforms as follows: Linux
  • Ubuntu 12.04, 13.04 et al
  • Fedora 19/20+
  • RHEL 6.5+
  • CentOS 6+
  • Gentoo
  • ArchLinux
  • openSUSE 12.3+
  • CRUX 3.0+
Microsoft Windows
  • Windows Server 2016
  • Windows 10
Cloud
  • Amazon EC2
  • Google Compute Engine
  • Microsoft Azure
  • Rackspace

5. What is Docker Engine?

Docker Engine is a Client-Server application installed on the host machine. It allows you to develop, assemble, ship, and run applications anywhere. It is available for Linux or Windows Server. Its major components are as follows:
  • Server is a long-running program called a Daemon process (docker )
  • REST API specifies interfaces that docker uses to communicate with Daemon and instruct it what to do.
  • CLI (Command Line Interface) uses the Docker REST API to manage and interact with the Daemon through its scripting commands.

6. What is the Lifecycle of Docker container?

The Lifecycle of Docker Container with CLI is below:
  • Create a Container.
  • Run the created Container.
  • Pause the processes running inside the Container.
  • Unpause the processes running inside the Container.
  • Start the Container, if exists in a stopped state.
  • Stop the Container as well as the running processes.
  • Restart the Container as well as the running processes.
  • Kill the running Container.
  • Destroy the Container, only if it exists in a stopped state.

7. List the most used commands of Docker.

  • ps lists the running containers.
  • dockerd launches Docker Daemon.
  • build is used to build an image from a DockerFile.
  • create is used to create a new image form container’s changes.
  • pull is used to download a specific image or a repository.
  • run is used to run a container.
  • logs display the logs of a container.
  • rm removes one or more containers.
  • rmi removes one or more images.
  • stop is used to stop one or more container.
  • kill is used to kill all running containers.

8. Does the data get lost, if the Docker container exits?

No. any data that our application writes to disk gets well preserved in its container until we explicitly delete the container and the file system persists even after the container halts.

9. What is Dockerfile and its use?

DockerFile is a text document used to assemble a Docker image.  It consists of a list of Docker commands and operating system commands for building an image. These commands execute automatically in sequence in the Docker environment and create a new Docker image.

10. How Docker is advantageous over Hypervisors?

Docker is advantageous. It is lightweight and more efficient in terms of resources as it uses very fewer resources and also the underlying host kernel rather than developing its hypervisor.

11. How to create a Docker container?

A Docker Container gets created by running any specific Docker image. Use the following command to create a container as this command creates and starts the container. docker run -t -i command name   If to verify that whether the container has created or whether that is running or not, use the following command as this command lists out all the running Docker containers on the host along with their status. docker ps -a

12. Can json be used instead of yaml for compose file?

Yes, json can be used instead of yaml for compose file such that you have to specify the file name with the following command: docker-compose -f docker-compose.json up 



ADVERTISEMENT
ADVERTISEMENT