• +91 9723535972
  • info@interviewmaterial.com

Docker Interview Questions and Answers

Related Subjects

Docker Interview Questions and Answers

Question - 51 : - Can you differentiate between Daemon Logging and Container Logging?

Answer - 51 : -

In docker, logging is supported at 2 levels and they are logging at the Daemon level or logging at the Container level.
Daemon Level: This kind of logging has four levels- Debug, Info, Error, and Fatal.
- Debug has all the data that happened during the execution of the daemon process.
- Info carries all the information along with the error information during the execution of the daemon process.
- Errors have those errors that occurred during the execution of the daemon process.
- Fatal has the fatal errors that occurred during the execution.
Container Level:
- Container level logging can be done using the command: sudo docker run –it /bin/bash
- In order to check for the container level logs, we can run the command: sudo docker logs

Question - 52 : - What is the way to establish communication between docker host and Linux host?

Answer - 52 : -

This can be done using networking by identifying the “ipconfig” on the docker host. This command ensures that an ethernet adapter is created as long as the docker is present in the host.

Question - 53 : - What is the best way of deleting a container?

Answer - 53 : -

We need to follow the following two steps for deleting a container:
- docker stop
- docker rm

Question - 54 : - Can you tell the difference between CMD and ENTRYPOINT?

Answer - 54 : -

CMD command provides executable defaults for an executing container. In case the executable has to be omitted then the usage of ENTRYPOINT instruction along with the JSON array format has to be incorporated.
ENTRYPOINT specifies that the instruction within it will always be run when the container starts. 
This command provides an option to configure the parameters and the executables. If the DockerFile does not have this command, then it would still get inherited from the base image mentioned in the FROM instruction.
- The most commonly used ENTRYPOINT is /bin/sh or /bin/bash for most of the base images.
As part of good practices, every DockerFile should have at least one of these two commands.

Question - 55 : - What are the steps for the Docker container life cycle?

Answer - 55 : -

Below are the steps for Docker life cycle:

  • Build
  • Pull
  • Run

Question - 56 : - How can you run multiple containers using a single service?

Answer - 56 : -

By using docker-compose, you can run multiple containers using a single service. All docker-compose files uses yaml language.

Question - 57 : - What is CNM?

Answer - 57 : -

CNM stands for Container Networking Model. It is a standard or specification from Docker, Inc. that forms the basis of container networking in a Docker environment. This docker’s approach provides container networking with support for multiple network drivers.

Question - 58 : - Does Docker offer support for IPV6?

Answer - 58 : -

Yes, Docker provides support IPv6. IPv6 networking is supported only on Docker daemons runs on Linux hosts. However, if you want to enable IPv6 support in the Docker daemon, you need to modify /etc/docker/daemon.json and set the ipv6 key to true.

Question - 59 : - Can you lose data when the container exits?

Answer - 59 : -

No, any data that your application writes to disk get stored in container. The file system for the contain persists even after the container halts.

Question - 60 : - What are a different kind of volume mount types available in Docker?

Answer - 60 : -

Bind mounts- It can be stored anywhere on the host system


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners