惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
V
V2EX
aimingoo的专栏
aimingoo的专栏
爱范儿
爱范儿
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
月光博客
月光博客
云风的 BLOG
云风的 BLOG

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Docker – Image and Container Bonding & Client-Server Arch...
Ramya Perumal · 2026-06-28 · via DEV Community
Cover image for Docker – Image and Container Bonding & Client-Server Architecture

Ramya Perumal

Question:

A container is running from an image. If we try to delete the image while the container is running, why can't we delete the image?

Answer:

If we attempt to delete the image, Docker will display an error message stating that the image is being used by a container.

The reason is that each line in a Dockerfile creates a layer.

Each layer is a read-only layer. Once a layer is created, it cannot be modified. If we want to make changes to the image, we need to create a new Dockerfile and build a new image.

When we create a container, only a reference to the image layers is passed to the container. The container has a writable layer, meaning we can create files, modify files, or generate output inside the container. These changes reside only in the container and do not affect the image.

However, the container always depends on the image. That is why we cannot delete the image while the container is using it.

This methodology is called Copy-on-Write (CoW).


Question:

If an image size is 10 GB, what will be the container size?

Answer:

A container contains only references to the image layers. Therefore, the container size consists of the files and changes stored in the writable layer running inside the container.


Question:

What command is used to find the size of a container?

docker ps --size

The Dive application is used to analyze each layer in a Docker image.


Client-Server Architecture

Docker works based on the Client-Server Architecture.

The Docker client sends requests to the Docker daemon, and the Docker daemon responds to the client.

If a requested image is not found on the local system, Docker retrieves it from a public repository.

docker run hello-world

This command pulls the image from the repository and runs it on the local system.


To pull an image from an image repository

docker pull busybox:1.36

To create a container

docker run busybox:1.36

To create a container, execute the ls command inside it, and exit immediately

docker run busybox:1.36 ls

To create a container and enter interactive mode

docker run -it busybox:1.36


Interview Questions

Question 1:

In a Client-Server architecture, who sends requests to the server?

Answer: The client.


Question 2:

What happens when a container is created from an image?

Answer: A writable layer is created.


Question 3:

What is the purpose of the writable layer in a container?

Answer: To handle file modifications and store changes made inside the container.


Question 4:

The read-only layers in Docker come from what?

Answer: The base image and its image layers.


Question 5:

What happens to the writable layer when the container is deleted?

Answer: It is discarded.


Question 6:

In a Docker environment, the client interacts with what?

Answer: The Docker daemon.


Question 7:

How do you start a container in interactive mode?

Answer:

docker run -it <image-name>