Why Docker Is Changing Software Development: A Hands‑On Introduction
This article introduces Docker, explains its origins, core concepts such as images, containers, and registries, demonstrates installation, common commands, building custom images, managing containers and images, and highlights its advantages in speed, resource efficiency, and portability for modern development workflows.
Quick Start
Docker began as an internal project at dotCloud.
It is written in Go.
Its goal is a lightweight OS‑level virtualization solution.
Based on Linux containers (LXC) and similar technologies.
Containers start in seconds, far faster than traditional VMs.
High resource utilization allows thousands of containers on a single host.
Docker containers virtualize at the operating‑system level, reusing the host OS instead of emulating hardware.
Containers consume minimal extra system resources, delivering high performance; ten applications require ten VMs but only ten isolated containers with Docker.
Main Advantages
Faster delivery and deployment – containers are the smallest unit.
More efficient kernel‑level virtualization.
Easier migration and scaling.
Simpler management.
Installation
Official installers are available for Mac, Linux, and Windows; follow the documentation.
Kitematic provides a graphical interface for easier Docker usage.
Daemon
Run the Docker daemon with -H to change the binding interface, e.g. sudo /usr/bin/docker -d -H tcp://0.0.0.0:2375. To avoid typing the full command each time, set the environment variable export DOCKER_HOST="tcp://0.0.0.0:2375".
Graphical User Interface
Web management tools such as Shipyard and Portainer can simplify container operations.
Basic Concepts
There are three core concepts:
Image : a read‑only template used to create containers; built on a layered UnionFS structure.
Container : a running instance created from an image, with its own writable layer, isolated processes, filesystem, and network.
Registry : a storage location for images, public (Docker Hub) or private.
What Docker Can Do
Standardize, optimize, and accelerate local development and build processes.
Ensure consistent runtime results across environments.
Create isolated test environments.
Isolation Provided by Docker
Filesystem isolation – each container has its own root filesystem.
Process isolation – containers run in separate process spaces.
Network isolation – separate virtual network interfaces and IP addresses.
Resource isolation – cgroups allocate CPU, memory, etc., per container.
Common Commands
sudo docker info– view Docker status. docker ps – list running containers (add -a for all, -l for the latest).
Running a Simple Example
Create and run an Ubuntu container:
docker run ubuntu:14.04 /bin/echo "Hello wdx!"Start an interactive Bash session: docker run -t -i ubuntu:14.04 /bin/bash Options: -t allocates a pseudo‑TTY, -i keeps STDIN open.
Building an Image
Create a directory, add a Dockerfile with:
FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsayBuild the image:
sudo docker build -t wdx-whale .Managing Images
List local images:
docker imagesTag and push a custom image:
docker tag 26ac9649d7da wdxtub/wdx-whale:latest
docker login --username=wdxtub [email protected]
docker push wdxtub/wdx-whaleContainer Lifecycle
Start: docker run (creates if missing, allocates filesystem, network, and runs the command).
Stop: docker stop <container_id>.
Restart: docker restart <container_id>.
Remove: docker rm <container_id> (add -f for running containers).
Export/Import and Deletion
Export a container:
docker export <container_id> > container.tarImport as an image:
cat container.tar | sudo docker import - myimage:latestSave and load images:
docker save -o wdx-local-whale.tar wdxtub/wdx-whale
docker load --input wdx-local-whale.tarRegistries
Registries store images; Docker Hub is public, while private registries can be self‑hosted. Use docker pull to download images and docker push to upload them.
Image layers are managed by UnionFS, enabling incremental changes and efficient storage.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
