Test Your Docker Knowledge

ComfortableJade avatar
ComfortableJade
·
·
Download

Start Quiz

Study Flashcards

54 Questions

What is the main task of a hypervisor?

To allocate resources to virtual environments

What are the two categories of hypervisors?

Native Hypervisor and Hosted Hypervisor

What is a Docker container?

A container for applications and their dependencies

What are some advantages of using Docker over other containerization methods?

Docker containers are easier to manage and deploy than other technologies

Which platform providers and large web deployments use container technology?

Heroku and dotCloud

How scalable are Docker containers and what are the requirements for scaling?

Containers can scale up to hundreds of thousands or even millions concurrently and require memory and OS available, along with a way to use this memory efficiently when scaled

What types of namespaces does Docker currently support?

PID, Mount, User, Network, IPC

What is the main benefit of using Docker?

Simplifying application delivery through easy packaging

What is the purpose of a hypervisor in virtualization?

To partition a single hardware system into various sections

What is the fractured nature of the container ecosystem?

Competition between container companies

What is the main component of Docker architecture?

A client-server application called the Docker engine

What is the default value of the restart flag for a Docker container?

False

When can docker-compose be used in production?

At various production stages such as CI, testing, staging, etc.

Is it recommended to run stateful applications over Docker?

No

Can JSON be used in place of YAML for composing files in Docker?

Definitely, since YAML is a superset of JSON

What command is used to log into a Docker registry?

docker login

Does Docker support IPv6?

Yes, but only for Docker daemons running on Linux hosts

What command is used to build a Docker file?

docker build

How can you create a Docker container using an image?

docker run -it -d <image_name>

What command is used to see all the running containers?

docker ps

What platforms does Docker support?

Multiple platforms including Linux, macOS, and Windows

Will your data be discarded when a Docker container exits?

No, all data will be saved

What is the main difference between virtualization and containerization?

Virtualization simulates the entire physical machine while containerization only simulates the OS.

What is Docker Swarm?

A native clustering solution for Docker.

What is Docker Machine?

A tool for installing Docker Engine on virtual hosts.

What is the difference between COPY and ADD commands in a Dockerfile?

COPY supports copying local files into the container while ADD provides additional features like remote URLs and tar extraction.

Where are Docker volumes stored on a Docker host?

/var/lib/docker/volumes

What is the purpose of Docker containers?

To eliminate infrastructure dependency when deploying and running applications

What is a DockerFile?

A file that contains all the commands for building a given image

What are Docker images?

Executable packages for creating containers

What is the purpose of Docker Compose?

To define and share multi-container applications

What are some downsides of using Docker?

Containers run at bare-metal speeds

What happens to data inside a container when the container shuts down?

The data disappears forever

Which of the following best describes the relationship between cloud services and containerization?

Cloud services and containerization can be used together to enhance functionality

In which of the following areas can Docker be used?

Code pipeline management

If you have an application with many dependant services, will docker-compose wait for the current container to be ready to move to the running of the next service?

Yes, docker-compose waits for the current container to be ready before moving to the next service

What is the purpose of Docker object labels?

To apply metadata to Docker objects

What does the memory-swap flag do in Docker?

Instructs the container to write excess memory requirements to disk

What is the purpose of container orchestration?

To automate container deployment

What does CNM stand for in Docker?

Container Network Model

What is Docker Trusted Registry used for?

To securely store and manage Docker images

What is Docker Trusted Registry (DTR)?

A tool for managing Docker containers on-premises or a private cloud

What commands can be used to control Docker with Systemd?

sudo systemctl start docker and sudo service docker start

What is Kubernetes?

An open-source containerization platform

What should you be prepared to talk about during a Docker interview?

Docker, Kubernetes, and other tools/technologies that compete with Docker

What is the recommended use of Docker-compose in production?

Docker-compose is the best practical use of Docker-compose in production.

What are the tools that can be used to monitor Docker in production?

Infrastructure, network, application performance, and last-mile monitoring and log analytics tools are needed to monitor Docker in production.

Is there a limit to the number of containers that can run per host?

No, there is no limit to the number of containers that can run per host.

What is the recommended way to remove a container?

Use the stop command to stop the container followed by the remove command to remove it.

What is the purpose of Docker Compose?

To manage multiple Docker containers as a single service

What is the difference between COPY and ADD commands in a Dockerfile?

COPY only copies local files while ADD can also extract tar files and remote URLs

What is the purpose of Docker object labels?

To add metadata to Docker images and containers

What is the difference between a registry and a repository?

A registry hosts and distributes images, while a repository is a collection of related images with different tags

Explain CMD and ENTRYPOINT in a Dockerfile.

Both specify which command should be executed while running a container, but ENTRYPOINT must be defined when using the container as an executable

Study Notes

Hypervisor and Containerization

  • The main task of a hypervisor is to manage and allocate resources to virtual machines (VMs) or containers.
  • There are two categories of hypervisors: Type 1 (bare-metal) and Type 2 (hosted).
  • A Docker container is a lightweight and standalone executable package of software that includes everything an application needs to run.

Docker Advantages and Scalability

  • Advantages of using Docker over other containerization methods include:
    • Lightweight and portable
    • Fast deployment and scaling
    • Isolated and secure environments
    • Easy management and orchestration
  • Docker containers are highly scalable, and scaling requirements include:
    • Adequate system resources (CPU, memory, and storage)
    • Proper network configuration and connectivity
    • Efficient use of Docker Swarm and other orchestration tools
  • Docker currently supports six types of namespaces: pid, net, ipc, mnt, utc, and user.

Docker Architecture and Components

  • The main component of Docker architecture is the Docker Engine, which consists of:
    • Docker daemon (dockerd)
    • Docker client (docker)
    • Container runtime (runc)
  • The default value of the restart flag for a Docker container is "no".
  • Docker supports multiple platforms, including Windows, Linux, and macOS.

Docker Commands and Usage

  • The docker login command is used to log into a Docker registry.
  • The docker build command is used to build a Docker image from a Dockerfile.
  • The docker run command is used to create a Docker container from an image.
  • The docker ps command is used to see all the running containers.
  • Docker volumes are stored on a Docker host in the /var/lib/docker/volumes directory.

Docker Containers and Data

  • The purpose of Docker containers is to provide a lightweight and portable way to package and deploy applications.
  • A DockerFile is a text file that contains instructions for building a Docker image.
  • Docker images are templates for creating containers.
  • Docker Compose is a tool for defining and running multi-container Docker applications.
  • When a Docker container exits, the data inside the container is discarded.
  • Stateful applications can be run over Docker, but it is not recommended.

Container Orchestration and Management

  • Docker Swarm is a container orchestration tool for deploying and managing containers at scale.
  • Docker Machine is a tool for creating and managing Docker hosts.
  • The purpose of container orchestration is to automate the deployment, scaling, and management of containers.
  • CNM stands for Container Network Model, which is a Docker networking system.
  • Docker Trusted Registry (DTR) is a secure registry for storing and managing Docker images.
  • Kubernetes is a popular container orchestration system that can be used with Docker.

Docker Interview and Best Practices

  • When preparing for a Docker interview, be prepared to discuss:
    • Docker architecture and components
    • Docker commands and usage
    • Container orchestration and management
    • Docker networking and security
  • The recommended use of Docker-compose in production is for development and testing environments.
  • Tools for monitoring Docker in production include:
    • Docker logs and metrics
    • Prometheus and Grafana
    • New Relic and Datadog
  • There is no limit to the number of containers that can run per host, but it depends on system resources.
  • The recommended way to remove a container is to use the docker rm command.

Docker Labels and Networking

  • The purpose of Docker object labels is to add metadata to Docker objects, such as containers and images.
  • The memory-swap flag is used to set the amount of swap space available to a container.
  • Docker supports IPv6, and the docker network command is used to manage Docker networks.
  • The difference between a registry and a repository is:
    • A registry is a collection of repositories
    • A repository is a collection of Docker images
  • The CMD instruction in a Dockerfile is used to set the default command to run when a container is started.
  • The ENTRYPOINT instruction in a Dockerfile is used to set the default entry point for a container.

Test your knowledge on Docker container restart and using Compose in production with this short quiz. Learn about the default behavior of container restarts and how to enable automatic restarts. Find out if running Docker Compose in production is a good idea based on real-world experience. Sharpen your understanding of Docker with this quick quiz.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Hypervisor Type 1 vs Type 2
20 questions
Understanding Hypervisor and Virtual Machines
30 questions
Use Quizgecko on...
Browser
Browser