Docker / Container
Technology to package applications with all dependencies. Containers enable consistent deployments and are the basis for Kubernetes.
Docker has changed how software is deployed. Instead of installing applications by hand and fighting dependency conflicts, Docker packs everything into a container: code, runtime, libraries and config. The result is the same behaviour everywhere – on a developer’s laptop, test server and production.
What is Docker / Container?
Docker is a container platform that packages applications and their dependencies into standard, isolated units (containers). A container has everything the app needs: code, runtime (e.g. Node.js), libraries and config. Unlike virtual machines (VMs), containers share the host kernel and are lighter (megabytes not gigabytes) and start in seconds. A Dockerfile defines the build; a Docker image is the result; a container is a running instance. Docker Compose runs multiple containers (e.g. app, database, Redis) for local development.
How does Docker / Container work?
Docker uses Linux kernel features (namespaces for isolation, cgroups for limits, union filesystems for images). A Dockerfile describes the build: base image (FROM node:20), install deps (RUN npm install), copy code (COPY . .), start command (CMD node server.js). Docker builds layered images – unchanged layers are cached. A registry (Docker Hub, GitHub Container Registry) stores and distributes images. In production, Kubernetes orchestrates many containers with scaling, rolling updates and service discovery.
Practical Examples
Local dev: docker compose up starts the full stack (frontend, backend, PostgreSQL, Redis) – same environment for every developer.
Multi-stage build: Dockerfile builds in one container and copies only the built artefact into a minimal production image – small and secure.
Microservices: Each service has its own image and is deployed, scaled and updated independently.
CI/CD: Tests run in Docker in the pipeline – same environment as production.
Typical Use Cases
Local development: Consistent environments, no 'works on my machine'
Microservices: Each service as its own container with its own lifecycle
CI/CD: Reproducible build and test environments
Deployment: Same setup from dev through staging to production
Legacy: Package existing apps in containers for cloud migration
Advantages and Disadvantages
Advantages
- Portability: Containers run the same everywhere
- Isolation: No dependency conflicts between apps
- Lightweight: Start in seconds, less resource than VMs
- Reproducibility: Dockerfile as code, versioned in Git
- Ecosystem: Huge library of images (databases, tools, languages)
Disadvantages
- Learning: Dockerfile optimisation, networking and volumes need know-how
- Security: Insecure base images or root in containers are common mistakes
- Overhead: For a simple static site Docker can be overkill
- State: Containers are ephemeral – databases and uploads need volumes
- Image size: Unoptimised images can grow large
Frequently Asked Questions about Docker / Container
What is the difference between Docker and a VM?
Do I need Docker for my project?
Docker or Kubernetes?
Related Terms
Want to use Docker / Container in your project?
We are happy to advise you on Docker / Container and find the optimal solution for your requirements. Benefit from our experience across over 200 projects.