Skip to content
GBHU753 edited this page May 19, 2024 · 1 revision

Docker

General Overview

Docker is a platform that allows you to develop, ship, and run applications in containers.

What is a Container?

Imagine you have a big box where you keep all your toys neatly organized. A container in the world of computers is somewhat similar. It's a lightweight, portable box that holds all the parts of a software application, including its code, libraries, operating system and other dependencies, so that it can run consistently across different environments. This means it can be ran anywhere regardless of the underlying system.

Here's a simpler breakdown:

  • Isolation: Each container is isolated from the others, meaning the applications inside them won't interfere with each other. It's like having separate toy boxes for different sets of toys so they don't get mixed up.

  • Portability: Containers can run on any computer that has the container platform installed. It’s like being able to take your toy box to a friend’s house and know you’ll be able to play with your toys there, no matter what kind of toy room your friend has.

  • Consistency: Since everything the application needs is inside the container, it will behave the same way everywhere. Just like how the toys inside your box are always the same, no matter where you take it.

  • Efficiency: Containers are lightweight because they share the operating system’s kernel, unlike virtual machines which need a full operating system for each instance. Think of it as a toy box that's very light to carry around because it uses a shared, efficient structure.

A popular tool to create and manage containers is Docker. Docker helps you package your applications into containers and makes it easy to run them anywhere, ensuring they work the same way regardless of where they are deployed. This is the primary reason why we are using Docker in our project.

What is a Pod?

A Pod is the smallest deployable unit in Docker. It represents a single instance of a running process in your cluster. Pods contain one or more containers. When a Pod runs multiple containers, the containers are managed as a single entity and share the Pod's resources. This allows you to run multiple containers that are tightly coupled and need to share resources, such as network and storage.

Example Scenario

Imagine you have an online store application. You might have:

  • A frontend container serving the web pages.
  • A backend container handling the business logic.
  • A database container storing the data.

Instead of managing these containers separately, you could group related ones (like backend and database) into a pod (we will be doing this later). This way, they can share the same environment and resources, making it easier to manage and setup.

Visualizing a Pod

Think of a pod like a spaceship with multiple astronauts (containers). The spaceship (pod) provides the environment and resources needed for the astronauts to survive and work together. Each astronaut has a specific role, but they all rely on the spaceship to function properly.

Summary

In summary, a pod is a fundamental unit that groups one or more containers with shared resources, making it easier to deploy, manage, and scale containerized applications.

Clone this wiki locally