Cloud & DevOps · PRACTICAL GUIDE

What Is Docker? Images and Containers Explained

Understand Docker images, containers, Dockerfiles and registries through a practical, beginner-friendly application workflow.

HANDBOOK JOURNEYByte 1 of 5View all Bytes
FAMILIAR SCENARIO

A sealed meal box travels consistently

A restaurant packs the dish, ingredients and handling instructions together so the same meal reaches Chennai or Coimbatore in a predictable form.

01Recipe
02Pack
03Transport
04Serve

Connect the idea: A container packages an application so it runs consistently across environments.

DOCKER HANDBOOK 01

What you will learn

Explain what a container packages, why it helps an application run consistently, and when a container is useful in a real development workflow.

Quick Start

Karthik builds a small Python application. On his laptop, clicking Start opens the application correctly. On his teammate's laptop, it stops with package not found. The same project is behaving differently because the two laptops do not have the same Python setup.

Docker helps Karthik carry the application together with the Python version and libraries it needs. That package can be tested once and used again by the team. Docker does not fix incorrect code; it makes the application setup more consistent.

SEE IT IN PRACTICE

THE FRIDAY DEPLOYMENT THAT FAILED ON QA

Karthik finishes an order-status application on Friday afternoon. QA cannot start it because a Python library is missing. Instead of asking QA to install tools one by one, Karthik creates a Docker image containing the application and its required setup. QA starts a container from that image and sees the same application Karthik tested.

Start from Basics

  • Dockerfile: A text file containing instructions for building an image.
  • Image: A prepared package containing the application and the files it needs to start.
  • Container: The running application created from an image.
  • Registry: A service that stores and distributes images; Docker Hub is one example.
  • Tag: A label used to identify an image version, such as 1.0.
  • Docker Engine: The Docker software that builds images and starts containers.

Core Explanation

CONCEPT LAB 01

Watch one app become a container

Select each stage. Notice when the app is only prepared and when it is actually running.

Recipe

Records how the app package must be prepared. Nothing is running yet.

GUIDED COMMAND SIMULATIONRun a command and watch what Docker creates
LEARNING MODE
SIMULATED TERMINAL
$ docker build -t order-app:1.0 .

Click execute — no real system changes are made

DOCKER OUTPUTWAITING

The created object will appear here

Browser learning simulation — this does not execute on your computer.
QUICK PREDICTIONIf this container stops, what can start the app again?

A developer writes a Dockerfile—the preparation instructions. Docker follows those instructions and creates an image—the prepared package. When Docker starts that image, the running result is a container. One image can start more than one separate container, just as one saved app installer can be used on more than one machine.

The team can keep the image in a registry, an online image store. Another team member can download that exact image and start a new container without rebuilding the setup manually.

Follow one application from code to container

  1. Karthik has app.py and a list of required Python libraries.
  2. He writes a Dockerfile that tells Docker which Python version to use, which files to copy and how to start the app.
  3. Docker reads those instructions and builds order-app:1.0, an image.
  4. Karthik starts the image. Docker creates a container and the application begins running.
  5. QA starts another container from order-app:1.0. Both containers came from the same prepared image.

The image is the saved source for new containers. Starting a container does not consume or change the original image. If one container stops, the image still exists and can start another container.

TAMIL LEARNER SUPPORT

Simple Tanglish — short-a remember pannunga

Dockerfile = preparation steps. Image = ready package. Container = running app. Image-ஐ start பண்ணினால்தான் container கிடைக்கும். One container stop ஆனாலும் image safe-ஆ இருக்கும்; same image-லிருந்து new container start பண்ணலாம்.

If the application changes, do not manually repair a running container and treat that as the solution. Update the source or Dockerfile, rebuild the image, test it and release a new version. That makes the result reproducible.

A container is not a complete second computer. It runs as an isolated process while sharing part of the host operating system. A virtual machine includes a complete guest operating system. For a beginner, the important difference is simple: containers usually start faster and package less than virtual machines.

Why not send only a ZIP file?

A ZIP file can carry source code, but the receiver may still need to install the correct Python version and libraries. A Docker image records much more of the required application setup. The receiver still needs Docker and a compatible machine, but fewer setup decisions are left to memory.

Architecture / Flow Diagram

BUILD, SHARE AND RUNOne application. Four Docker objects. Two different paths.
ANIMATED MODEL

01 BUILD PATH happens when the code changes

ApplicationCode + dependencies
+
DockerfileBuild instructions
docker buildExecutes the recipe
ImageImmutable, versioned package
The image can now be shared or run
SHARE PATH
docker pushRegistrystores imagesdocker pull
RUN PATH
docker runContainer Arunning processContainer Bsame image, separate process
The key distinction: a registry stores images—not running containers. One image can create many independent containers.

Read the animation from left to right: Dockerfile → image → container. The registry is the shelf where the team can store the image. Do not worry about ports, storage or networking yet; this Byte is only about how an application becomes a reusable image and then a running container.

Types / Components

ComponentJobBeginner checkpoint
DockerfileDescribes the buildKeep it with the source code
ImageKeeps the prepared application packageIt is not running yet
ContainerRuns one copy of the applicationIt starts from an image
RegistryShares image versionsUse identifiable versions
Docker EngineFollows the build instructions and starts containersDocker must be installed

Image and container: do not mix them up

QuestionImageContainer
Is the application running?NoYes
Can the team store and share it?YesUsually the image is shared instead
Can one create several running copies?YesEach copy is a separate container
What happens when a container stops?The image remains availableThat running copy stops

Container vs Virtual Machine

Decision pointContainerVirtual machine
Operating systemShares the host kernelRuns a full guest OS
StartupUsually fastUsually slower
PackageApplication and dependenciesApplication, dependencies and guest OS
Best fitPortable application workloadsDifferent OS or stronger isolation needs

Neither is universally better. Choose according to workload, security and operating-system requirements.

Real-World Examples

Do not begin with company architecture. Begin with a familiar team problem: the application works for one person but fails for another. Read each card as before Docker → team action → after Docker. Notice that Docker changes the setup process; it does not change the application's business logic.

BEFORE → ACTION → AFTERRead each story from the failed setup to the result the team can see.
Food-delivery API
Before Docker
Karthik’s app works, but QA is missing Python 3.12 and one library.
Team action
Karthik builds and shares order-status:1.0.
After Docker
QA starts a container and sees the same health response.
SETUP MATCHED
Checkout release
Before Docker
Developers and testers are unsure which checkout setup belongs to release 2.1.
Team action
The team tests the tagged image checkout:2.1.
After Docker
Everyone tests the clearly identified release package.
SETUP MATCHED
New developer joining
Before Docker
Priya receives a long setup document, but two steps are already outdated.
Team action
Priya starts a container from the approved team image.
After Docker
The project opens without rebuilding the setup from memory.
SETUP MATCHED
Docker does not fix application bugs. In these examples, it removes uncertainty about the Python version, libraries and selected release package.

Imagine Pannunga

Imagine a standard shipping container. Goods can move from a ship to a train and then to a lorry without being repacked for each vehicle. The standard box makes handling predictable.

A Docker image follows the same packaging idea: prepare the application once, then use that package in another compatible Docker environment. The image is the packed box; the container is the opened box doing its job.

Use Cases

The same Docker idea creates a different benefit for each role. Start with the person's question, then connect it to the correct Docker action.

WHO USES THIS — AND WHY?Choose the person first; the Docker benefit becomes clearer.
Developer

“Will it run for my teammate?”

Create a repeatable image
QA engineer

“Am I testing the same version?”

Start the approved tag
DevOps engineer

“Can the same release move through environments?”

Promote one versioned image
Platform / SRE engineer

“Can we operate and replace it safely?”

Apply limits, health checks and monitoring
Docker is useful when the learner needs the same prepared application setup in another place.

Key Takeaways

  1. Docker reduces differences between application environments.
  2. A Dockerfile contains image-build instructions.
  3. An image is a reusable, read-only package.
  4. A container is a running image instance.
  5. A registry stores and distributes image versions.
  6. Multiple containers can be created from one image.
  7. Containers and virtual machines use different isolation models.
  8. Docker packaging does not replace testing, security or monitoring.

Final Thought + Next Path

Remember one flow: Dockerfile prepares the instructions → image stores the package → container runs the app. In Byte 02, you will use that flow yourself: write a small Dockerfile, build one image and start one container. Do not move to ports or storage yet—the next Byte has only one goal: make your first packaged app run.

FAQ + Knowledge Check

LESSON CHECKPOINTConfirm the concept before moving forward

Choose an answer, inspect the explanation and explain the idea in your own words.

RETENTION

Will Docker fix application bugs? No. It reduces environment differences; application defects still require debugging and tests.

Can one image create several containers? Yes. Each container is a separate running copy.

Is a container the same as a VM? No. Their operating-system and isolation models differ.

Interview-ready answer: A Docker image is a prepared, versioned package containing an application and the files it needs. A container is a running copy created from that image. A Dockerfile contains the instructions used to build the image.

Knowledge Check — one mark for each correct answer

  1. Where are image-build instructions stored? Dockerfile
  2. What is a running image instance called? Container
  3. What stores and distributes images? Registry
  4. Does a container normally run a complete guest OS? No
  5. Does Docker replace application tests? No

Score: 5/5 — continue to Byte 02. 3–4 — review Core Explanation once. 0–2 — revisit Start from Basics and the visual flow before continuing.

Learning rule: explain the answer in your own words before checking the next Byte.

Primary sources

OPTIONAL LEARNING CONNECTIONS

Continue by concept

Choose only what supports your next goal. This Byte does not require either link.