1 / 36

Docker Interview Questions | Docker Interview Questions And Answers | DevOps Tools | Simplilearn

Welcome to this presentation on Docker interview questions and answers. Docker is a popular DevOps tool used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments. Docker was initially released in 2013 and since then has become the go-to solution for containerization. In this video, we have compiled the most important Docker interview questions that you might face in a Docker or DevOps interview. Now, let us get started with the Docker Interview Questions and Answers.<br><br>Docker Certified Associate (DCA) Certification Training Course:<br>This hands-on training course is aligned with the Docker Certified Associate (DCA) examination. You will learn core Docker technologies such as Docker Hub, Docker Compose, Docker Swarm, Dockerfile, Docker Containers, Docker Engine, Docker Images, Docker Network, Docker Daemon, and Docker Storage.<br><br>Course Overview:<br>This training course is aligned with the Docker Certified Associate (DCA) Certification body and covers the fundamentals of Docker. You will be able to comprehend Docker and its role in the DevOps lifecycle; create images, containers, swarms, volumes, and networks; define Docker security client bundles and client-server authentication; and more.<br><br>Eligibility:<br>Anyone interested in learning Docker will benefit from this Docker Certified Associate course. This DCA course also is well-suited for: Freshers, Software developers, Software engineers, Technical leads, System administrators.<br><br>Pre-requisites:<br>In order to take full advantage of this Docker training course, you will need to have a solid knowledge of Linux, including hands-on experience.<br><br>Learn more at https://www.simplilearn.com/docker-certified-associate-dca-certification-training-course

Simplilearn
Télécharger la présentation

Docker Interview Questions | Docker Interview Questions And Answers | DevOps Tools | Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Docker Interview Questions

  2. 1 Explain the architecture of Docker REST API Docker Server Build • Docker uses a client-server architecture Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  3. Click here to watch the video

  4. 1 Explain the architecture of Docker REST API Docker Server Build • Docker uses a client-server architecture • Docker Client is a service which runs a command. The command is translated using REST API and is sent to the Docker Daemon (server)  Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  5. 1 Explain the architecture of Docker REST API Docker Server Build • Docker uses a client-server architecture • Docker Client is a service which runs a command. The command is translated using REST API and is sent to the Docker Daemon (server)  • Docker Daemon accepts the request and interacts with the operating system in order to build Docker Images and run Docker containers Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  6. 1 Explain the architecture of Docker REST API Docker Server Build • Docker uses a client-server architecture • Docker Client is a service which runs a command. The command is translated using REST API and is sent to the Docker Daemon (server)  • Docker Daemon accepts the request and interacts with the operating system in order to build Docker Images and run Docker containers • A Docker Image is a template of instruction which is used to create containers Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  7. 1 Explain the architecture of Docker REST API Docker Server Build • Docker container is an executable package of application and its dependencies together Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  8. 1 Explain the architecture of Docker REST API Docker Server Build • Docker container is an executable package of application and its dependencies together • Docker registry is a service to host and distribute Docker Images among users Docker Host Pull Docker Client Registry Docker Daemon Run Container Container Images

  9. 2 What are the advantages of Docker over Virtual machine Criteria Docker Virtual Machine Memory space Boot-up time Performance Scaling Efficiency Occupies a lot of memory space Long boot-up time Running multiple virtual machines leads to unstable performance  Difficult to scale up Low efficiency Docker Containers occupy less space Short boot-up time Containers have a better performance as they are hosted in a single Docker engine Easy to scale up High efficiency Portability Space allocation Easily portable across different platforms Data volumes can be shared and reused among multiple containers Compatibility issues while porting across different platforms Data volumes cannot be shared

  10. 3 How do we share Docker containers with different nodes? Docker Swarm Manager node • It is possible to share Docker containers on different nodes by using Docker swarm Worker node1 Worker node2 Worker node3 Docker Container

  11. 3 How do we share Docker containers with different nodes? Docker Swarm Manager node Docker Platform • It is possible to share Docker containers on different nodes by using Docker swarm • Docker swarm is a tool which allows IT administrators and developers to create and manage a cluster of swarm nodes within the Docker platform Worker node1 Worker node2 Worker node3

  12. 3 How do we share Docker containers with different nodes? Manager node Worker node • It is possible to share Docker containers on different nodes by using Docker swarm • Docker swarm is a tool which allows IT administrators and developers to create and manage a cluster of swarm nodes within the Docker platform • A swarm consists of two types of nodes: manager node and worker node

  13. 4 What are the commands to create a Docker swarm? • Create a swarm where you want to run your manager node • Docker swarm init --advertise-addr <MANAGER-IP>

  14. 4 What are the commands to create a Docker swarm? • Create a swarm where you want to run your manager node • Docker swarm init --advertise-addr <MANAGER-IP> • Once you’ve created a swarm on your manager node, you can add worker nodes to your swarm

  15. 4 What are the commands to create a Docker swarm? • Create a swarm where you want to run your manager node • Docker swarm init --advertise-addr <MANAGER-IP> • Once you’ve created a swarm on your manager node, you can add worker nodes to your swarm • When a node is initialized as a manager node, it immediately creates a token. In order to create a worker node, the following command (token) should be executed on the host machine of a worker node • Docker swarm join \ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ 192.168.99.100:2377

  16. 5 How to run multiple containers using a single service? { • It is possible to run multiple containers as a single service by using Docker compose • Here, each container runs in isolation but can interact with each other • All Docker Compose files are YAML files Docker Compose Containers

  17. 6 What is the use of a Dockerfile? • In Docker, Docker File is used for creating Docker Images using the build command Docker File Note: Docker Image contains all the project’s code

  18. 6 What is the use of a Dockerfile? • In Docker, Docker File is used for creating Docker Images using the build command • With Docker Image, any user can run the code in order to create Docker Containers Docker Image Docker File Docker Container

  19. 6 What is the use of a Dockerfile? • In Docker, Docker File is used for creating Docker Images using the build command • With Docker Image, any user can run the code in order to create Docker Containers • Once a Docker Image is built, it’s uploaded in a Docker registry Docker Image Docker Hub Docker File Docker Container

  20. 6 What is the use of a Dockerfile? • In Docker, Docker File is used for creating Docker Images using the build command • With Docker Image, any user can run the code in order to create Docker Containers • Once a Docker Image is built, it’s uploaded in a Docker registry • From the Docker Registry, users can get the Docker Image and build new containers whenever they want Container Docker Image Docker Hub Docker File Container Docker Container

  21. 7 Differences between Docker Image and Docker Container • Containers are runtime instances of a Docker Image • Containers are created using Docker Images • They are stored in the Docker daemon • Every container layer is a read-write filesystem • Docker Images are templates of Docker Containers • An image is built using a Dockerfile • It is stored in a Docker repository or a Docker hub • The image layer is a read only filesystem Docker Images Docker Container

  22. 8 Instead of YAML what can be an alternate file to build Docker compose To build a Docker compose, a user can use a JSON file instead of YAML In case a user wants to use a JSON file, he/she should specify the filename as given: Command Docker-compose -f Docker-compose.json up

  23. 9 How to create a Docker container? • Task: Create a MySQL Docker container

  24. 9 How to create a Docker container? • Task: Create a MySQL Docker container • A user can either build a Docker Image or pull an existing Docker Image (like MySQL) from Docker hub • Now, Docker creates a new container MySQL from the existing Docker Image. Simultaneously, container layer of read-write filesystem is also created on top of the Image layer • Command to create a Docker container: Docker run -t –i MySQL • Command to list down the running containers: Docker ps

  25. 10 What is the difference between a Registry and a Repository Registry Repository • Repository is a collection of multiple versions of Docker Image • Docker Registry is an open source server-side service used for hosting and distributing Docker Images

  26. 10 What is the difference between a Registry and a Repository Registry Repository • Repository is a collection of multiple versions of Docker Image • It is stored in Docker Registry • Docker Registry is an open source server-side service used for hosting and distributing Docker Images • In a Registry, a user can distinguish between Docker Images with their tag names Note: A tag is a alphanumeric identifier attached to a image

  27. 10 What is the difference between a Registry and a Repository Registry Repository • Repository is a collection of multiple versions of Docker Images • It is stored in Docker Registry • It has two types - Public and private repositories • Docker Registry is an open source server-side service used for hosting and distributing Docker Images • In a Registry, a user can distinguish between Docker Images with their tag names • Docker also has its own default registry called Docker Hub

  28. 11 What are the Cloud platforms that support Docker? • Below are the Cloud platforms that Docker runs on: • Amazon Web Services • Microsoft Azure • Google Cloud Platform • Rackspace

  29. 12 What is the purpose of expose and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • Publish is used in Docker run command

  30. 12 What is the purpose of expose and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • It is used to expose ports within a Docker network • Publish is used in Docker run command • It can be used outside a Docker environment

  31. 12 What is the purpose of EXPOSE and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • It is used to expose ports within a Docker network • It is a documenting instruction used at the time of building an image and running a container • Publish is used in Docker run command • It can be used outside a Docker environment • It is used to map a host port to a running container port

  32. 12 What is the purpose of EXPOSE and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • It is used to expose ports within a Docker network • It is a documenting instruction used at the time of building an image and running a container • Expose is the command used in Docker • Publish is used in Docker run command • It can be used outside a Docker environment • It is used to map a host port to a running container port • --publish or –p is the command used in Docker

  33. 12 What is the purpose of EXPOSE and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • It is used to expose ports within a Docker network • It is a documenting instruction used at the time of building an image and running a container • Expose is the command used in Docker • Publish is used in Docker run command • It can be used outside a Docker environment • It is used to map a host port to a running container port • --publish or –p is the command used in Docker • Note: In case you do not use Expose or --publish, no ports will be exposed

  34. 12 What is the purpose of EXPOSE and publish command in Docker? Expose Publish • Expose is an instruction used in Dockerfile • It is used to expose ports within a Docker network • It is a documenting instruction used at the time of building an image and running a container • Expose is the command used in Docker • Example: Expose 8080 • Publish is used in Docker run command • It can be used outside a Docker environment • It is used to map a host port to a running container port • --publish or –p is the command used in Docker • Example: docker run –d –p 0.0.0.80:80

More Related