Why Docker Containers Revolutionize Application Deployment
This article explains how Docker containers, built on Linux kernel virtualization, provide lightweight isolation, higher resource efficiency, rapid startup, consistent environments, easy migration, and simplified maintenance, and walks through installation, image creation, registry usage, and deployment on Huawei Cloud SWR.
Container technology originates from Linux kernel virtualization, providing lightweight isolation. Docker popularized containers by enabling portable packaging of applications, libraries, and even the OS filesystem.
Compared to virtual machines, containers offer higher resource efficiency, faster startup (seconds or milliseconds), consistent runtime environments, easier migration across platforms, and simpler maintenance and scaling.
Key Docker Concepts
Image : packaged application with its dependencies and filesystem.
Image Registry : stores and shares images, can be public or private.
Container : runtime instance of an image, isolated process on the host.
Typical Docker Workflow
1. Build an image on the development machine.
2. Push the image to a registry.
3. Pull the image on a production host and run a container.
Installation Example (Linux)
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.shFor CentOS 8, use a lower‑version package:
wget -O /etc/yum.repos.d/docker-ce.repo https://repo.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+repo.huaweicloud.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum install docker-ce-18.06.3.ce -y
systemctl restart dockerBuilding and Running a Simple Image
# Dockerfile
# Use official Nginx image
FROM nginx:alpine
# Modify index.html
RUN echo "hello world" > /usr/share/nginx/html/index.html
EXPOSE 80Build and tag the image: docker build -t hello . List images:
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello latest d120ec16dcea 17 minutes ago 158MB
nginx alpine eeb27ee6b893 2 months ago 148MBRun the container locally: docker run -p 8080:80 hello Access http://127.0.0.1:8080 to see “hello world”.
Pushing to Huawei Cloud SWR
Tag the image with the registry address and push:
# docker tag hello swr.cn-east-3.myhuaweicloud.com/container/hello:v1
docker push swr.cn-east-3.myhuaweicloud.com/container/hello:v1Pull the image later with:
docker pull swr.cn-east-3.myhuaweicloud.com/container/hello:v1Signed-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.
Huawei Cloud Developer Alliance
The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.
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.
