Inno I- Docer/k8s Flashcards
What is Docker and what are its key features?
Docker is an open platform for developing, shipping, and running applications. Key features include:
Containerization: Packages applications with all dependencies
Lightweight: Containers share the host OS kernel, reducing overhead
Portability: Runs consistently across different environments
Fast deployment: Containers start in seconds
Version control: Allows easy tracking of image versions
Isolation: Provides secure, isolated environments for applications
What is Docker Compose and how does it enhance Docker functionality?
Docker Compose is a tool for defining and running multi-container Docker applications. It enhances Docker by:
Using YAML files to configure application services
Simplifying management of multiple containers
Automating container creation and startup
Facilitating easy scaling of services
Providing built-in networking between containers
Enabling persistent volume management
Supporting environment variables for flexible configurations
Streamlining development, testing, and deployment workflows
What is Docker?
Docker is an open platform for developing, shipping, and running applications2. It enables developers to:
Package applications with all dependencies
Separate applications from infrastructure
Deliver software quickly
Manage infrastructure and applications similarly
What are the key components of Docker?
The key components of Docker are:
Docker Engine: Core component for running and managing containers
Docker Daemon (dockerd): Listens for Docker API requests and manages Docker objects
Docker Client: Primary way users interact with Docker through commands
Docker Desktop: Easy-to-install application for Mac, Windows, or Linux
Docker Hub: Centralized repository for sharing and distributing container image
How does Docker differ from virtual machines?
Docker containers differ from virtual machines (VMs) in the following ways1:
Containers share the host OS kernel, while VMs run on hypervisors with full guest OS
Containers are lightweight and start in milliseconds; VMs are heavier and take longer to boot
Docker allows running multiple containers on a single host with less overhead
Containers provide better performance and resource utilization compared to VMs
What is containerization in Docker?
Containerization in Docker1:
Packages applications and dependencies into isolated units called containers
Leverages the host operating system’s kernel
Allows multiple containers to run simultaneously on a single machine
Provides consistent environments across development, testing, and production
Eliminates the “it works on my machine” problem
Enhances portability across various platforms
Docker achieves strong isolation between containers by1:
**Utilizing Linux features like namespaces and control groups (cgroups)
**
Running each container in its own isolated environment
Preventing processes in one container from interfering with others
Employing user namespaces to map container root users to unprivileged host users
Allowing resource limits on containers to maintain system stability
What are the benefits of using Docker?
Benefits of using Docker include:
Fast, consistent delivery of applications
Responsive deployment and scaling
Running more workloads on the same hardware
Simplified application development and management
Portability across different environments
Isolation and security for running multiple containers
Efficient use of system resources
What is Docker Compose?
Docker Compose is a tool for:
Defining and running multi-container Docker applications
Managing complex applications using a single YAML file
Simplifying the orchestration and coordination of various services
Streamlining development, deployment, and management of containerized applications
What are the key features of Docker Compose?
Key features of Docker Compose include:
YAML-based configuration
Service definition
Container networking
Scalability and load balancing
Volume management
Environment variables support
Inter-container communication
Compose CLI for managing application stacks
How does Docker Compose simplify application management?
Docker Compose simplifies application management by:
Allowing definition of multi-container applications in a single YAML file
Providing a unified way to manage services, networks, and volumes
Enabling easy sharing of application configurations among team members
Supporting variables for customizing compositions across environments
Offering caching of configurations for faster container creation
Allowing rapid prototyping and iteration in development
What are common use cases for Docker Compose?
Common use cases for Docker Compose include:
Development environments: Quickly setting up isolated environments
Automated testing: Creating and destroying test environments easily
Single host deployments: Managing multiple services on a single machine
CI/CD workflows: Supporting continuous integration and deployment processes
Prototyping: Rapidly creating and testing multi-container applications
How does Docker Compose handle networking?
Docker Compose handles networking by:
Creating a default bridge network for all services to communicate
Allowing definition of custom networks for better control
Providing built-in network isolation for containers
Simplifying the setup of microservices architectures
Enabling seamless communication between containers within the same Compose proje
How do you define services in a Docker Compose file?
Services in a Docker Compose file are defined under the services section. A basic service definition includes:
Image or build instructions
Ports to expose
Environment variables
Volumes
Networks
Dependencies on other services
How does Docker Compose handle service dependencies?
Docker Compose handles service dependencies using the depends_on option7. This ensures that dependent services start in the correct order.
What are the essential Docker commands for managing containers?
docker run: Create and start a container
docker ps: List running containers
docker ps -a: List all containers (including stopped ones)
docker stop: Stop a running container
docker start: Start a stopped container
docker rm: Remove a container
docker logs: View container logs
docker exec: Execute a command in a running container
How do you build and manage Docker images?
docker build: Build an image from a Dockerfile
docker images: List available images
docker pull: Download an image from a registry
docker push: Upload an image to a registry
docker rmi: Remove an image
docker tag: Tag an image with a name and optional tag
What is a Docker image?
A Docker image is a read-only template containing a set of instructions for creating a container. It includes the application code, runtime, libraries, environment variables, and config files needed to run an application.
What is a Docker container?
A Docker container is a runnable instance of a Docker image. It’s a lightweight, standalone, executable package that includes everything needed to run an application, including the code, runtime, system tools, libraries, and settings.
What is a Dockerfile?
A Dockerfile is a text file containing instructions for building a Docker image. It specifies the base image, adds application code, sets environment variables, installs dependencies, and configures the container’s behavior.
What is Docker Hub?
Docker Hub is a cloud-based registry service provided by Docker for storing and sharing container images. It offers both public and private repositories, allowing users to push, pull, and manage Docker images.
What is a Docker volume?
A Docker volume is a mechanism for persisting data generated by and used by Docker containers. Volumes are stored in a part of the host filesystem managed by Docker and are independent of the container’s lifecycle, allowing data to persist even after a container is removed.
What is a Kubernetes Cluster?
A Kubernetes Cluster is a set of worker machines, called nodes, that run containerized applications orchestrated by a control plane. It consists of:
One or more worker nodes
A control plane (also called the Kubernetes master)
Various components for managing the cluster’s state and operations
What are the main components of the Kubernetes Control Plane?
The Kubernetes Control Plane includes:
kube-apiserver: Exposes the Kubernetes HTTP API
etcd: Consistent and highly-available key-value store for all API server data
kube-scheduler: Assigns Pods to suitable nodes
kube-controller-manager: Runs controllers to implement Kubernetes API behavior
cloud-controller-manager (optional): Integrates with underlying cloud providers