What is Docker?
DEFINITION
Docker is a platform for packaging an application and everything it needs into a lightweight container that runs the same way on any machine or server.
Docker is a widely used tool for building and running containers. A container bundles an application with its runtime, libraries and configuration, isolated from other software on the same host. Developers describe how to build the container in a text file called a Dockerfile, which produces an image. That image can be stored in a registry and started as a container on a laptop, a test server or a cloud platform.
Unlike virtual machines, containers share the host's operating system kernel, so they start quickly and use fewer resources.
Why Docker matters
It solves the classic problem of software that works on one machine but fails on another because of different versions or settings. Every environment, from development to production, runs the same image. That consistency speeds up onboarding for new developers, makes CI/CD pipelines more reliable, and lets teams move applications between hosting providers with less effort.
Using Docker securely
Containers add isolation but are not a security boundary on their own. Start from small, official or verified base images and rebuild regularly so security patches are included. Scan images for known vulnerabilities in your CI pipeline. Run applications as a non-root user inside the container, avoid baking passwords or API keys into images, and pass secrets at runtime instead. For example, a team containerizing a Node.js API might use a slim official Node image, install only production dependencies, copy in the compiled code, switch to a non-root user, and have the pipeline fail the build if the image scan finds a critical vulnerability.
Best practices
- Pin base images to specific versions and update them on a regular schedule.
- Keep images small by including only what the application needs to run.
- Scan images for vulnerabilities before they are pushed to production.
- Run containers as a non-root user with only the permissions they require.
Common mistakes
- Storing secrets such as database passwords inside the image, where anyone with access to it can read them.
- Using a latest tag in production, which makes deployments unpredictable.
- Exposing the Docker daemon or its socket to the network without strong protection.
Frequently asked questions
What is the difference between Docker and a virtual machine?
A virtual machine emulates an entire computer with its own operating system, which makes it heavier and slower to start. A Docker container shares the host's kernel and packages only the application and its dependencies, so it is lighter and starts in seconds. VMs offer stronger isolation; containers offer speed and density.
What is the difference between Docker and Kubernetes?
Docker builds and runs individual containers. Kubernetes orchestrates many containers across a cluster of servers, handling scheduling, scaling, restarts and networking. Teams often build images with Docker and run them on Kubernetes, though Kubernetes can run containers built with other compatible tools too.
Is Docker free to use?
The core open-source container engine is free. Docker Desktop, the application many developers use on Mac and Windows, is free for personal use, education and small businesses, while larger companies need a paid subscription under its license terms. Check the current terms, as thresholds can change.
Need help with this?
클라우드 및 DevOps by VYZEON — 스스로 확장하고, 배포하고, 복구하는 인프라.
Fixed packages from $199. Written scope, no surprises.
