The application works on one developer’s machine and fails on another. A container can make its runtime and system dependencies repeatable, but it does not decide how the application stores data, receives traffic or survives a failed host.
Docker builds images and runs isolated processes using operating-system container capabilities. It is valuable when the same tested artefact moves through development and production. It is extra machinery when a simple, well-controlled service package already deploys predictably.
We choose Docker by defining the operational boundary around the container. How many services fit in a Compose file tells you very little.
A container packages a process, not the whole service
An image can contain the application, runtime, libraries and startup command. The running container still depends on a host kernel, network, storage, secrets, DNS and external services. Docker’s container overview explains the isolation model without presenting containers as virtual machines.
We normally give each container one clear service responsibility. That may include a main process and a small init, but it avoids treating a container as a server where administrators install packages and edit configuration after launch.
The image is immutable in the release model. A production fix creates a new image, passes tests and replaces the container. Changes made inside a running container disappear on replacement and create state nobody can reproduce.
Health depends on more than the process existing. Readiness should verify that the application can accept work; liveness should only restart a process that cannot recover. Aggressive checks can turn a slow dependency into a restart loop.
The Dockerfile becomes part of the supply chain
Every base image and installed package joins the product’s dependency inventory. A short Dockerfile can still pull mutable tags, remote scripts and build tools with broad network access.
Docker’s build best practices recommend trusted, small base images, .dockerignore, multi-stage builds and frequent rebuilding. Pinning a digest gives exact provenance, while also making update automation necessary because the digest will not move to a patched image by itself.
We separate build and runtime stages so compilers, package caches and source credentials do not enter production layers. The final image contains only what the process needs. Build secrets use the builder’s secret mechanism rather than ARG or copied files that can remain in image history.
An image scan is a triage tool. Vulnerability records need checking against the actual package, reachability and fixed versions. A clean scan does not assess application logic, and a large count does not establish equal risk.
Container security begins with reduced privilege
A container is an isolation boundary on a shared kernel, not a reason to run everything as root. We use an unprivileged user where the application permits it, drop capabilities, avoid privileged mode and mount only required paths.
Docker documents rootless mode as a way to run the daemon and containers without root privileges. It changes networking and host constraints, so it should be chosen and tested rather than enabled as a label.
The Docker socket is highly privileged. Mounting it into a management container can grant control over other containers and the host. Access is restricted to the smallest administrative route and never exposed casually over the network.
Secrets arrive at runtime with narrow file or environment access and a rotation plan. Environment variables are convenient but can appear in diagnostics and process metadata. The delivery mechanism should match the orchestrator and threat model.
CPU and memory limits make contention explicit
Without resource controls, one container can consume host memory or CPU needed by its neighbours. Docker’s resource constraints cover memory and CPU settings and warn about out-of-memory behaviour.
Limits are based on measurement. A memory limit below normal application peaks causes repeated termination; no limit can let a leak destabilise the host. We monitor container working set, throttling, restarts and the host capacity beneath them.
Application concurrency should respect the allocation. Giving a PHP or Node container a one-CPU limit while starting workers sized for eight CPUs creates queueing and misleading latency. The image can remain identical while environment-specific process counts are configured deliberately.
Capacity also includes image and log storage. Unbounded JSON logs or old build layers can fill a small host while the application appears healthy.
Persistent data must outlive container replacement
The writable container layer is disposable. Databases, customer uploads and durable queues need volumes or external managed services, with backups suited to the data system.
A volume preserves files when a container is recreated; it is not automatically backed up or portable between hosts. Database consistency and restore testing still apply. Bind mounts can be useful in development but tie a production deployment to host paths and permissions.
We prefer disposable application containers and external durable data. This makes rollback and horizontal replacement easier. If an application writes essential state locally, that behaviour is documented and exercised during migration.
Development convenience should not leak into production. Mounting the live source tree, exposing database ports and running debug tooling are different decisions from the packaged release.
Docker Compose can be enough for a controlled host
Compose describes related containers, networks, volumes and configuration. On one or a few understood hosts, it can provide a readable production deployment without a cluster control plane.
Docker’s production Compose guidance recommends separate production configuration, restart policies, appropriate ports and no source-code bind mounts. Deployment still needs image pull, migration ordering, health, rollback and host recovery.
Compose does not move a service automatically when its host fails. If recovery time permits rebuilding or starting a replacement host, that may be acceptable. If the business needs automatic multi-host placement and rolling capacity, a managed container service or orchestrator can earn its complexity.
Kubernetes should follow workload and organisational needs; having containers is no reason on its own to run it. A control plane adds networking, policy, upgrades and specialist diagnosis that a modest application may never repay.
Container updates replace images rather than patching them in place
Base-image and application fixes reach production through rebuild and redeployment. Restarting an old container does not fetch a patched layer. Tags such as latest can also make two deployments with the same configuration run different bits.
We record image digest, source commit and build time, then promote the same artefact through environments. Automated rebuilds open an update proposal and tests rather than silently changing production.
The host and Docker Engine need their own patch policy. Containers do not contain the shared kernel, so host vulnerabilities and reboot planning remain Linux responsibilities unless a provider owns that layer.
Rollback uses a known earlier image and compatible data state. A database migration that cannot run with both versions can make image rollback unsafe despite perfect container packaging.
Questions to answer before adopting Docker
- “Which inconsistency or deployment problem will containers solve?” Name the value.
- “What enters the image, and which source pins prove it?” Control base and build supply chain.
- “Which user and capabilities does the process need?” Reduce privilege by design.
- “What CPU, memory and concurrency will each service receive?” Test limits under load.
- “Which state must survive replacement, and where is it backed up?” Keep containers disposable.
- “Is Compose recovery enough, or is multi-host orchestration justified?” Start from availability.
- “How are base images rebuilt and deployed after a fix?” Patching means replacement.
When Docker is a sound delivery boundary
Choose Docker when a repeatable application artefact, isolated dependencies and environment parity reduce meaningful delivery risk. It works well for teams running several services, CI jobs or applications across hosts with a clear image pipeline.
A single-host Compose deployment can be a mature choice when its recovery objective permits it. Managed container services become useful when scheduling and host operation would otherwise dominate the team’s work.
When containers add a layer without enough value
Keep a conventional package or service deployment when one application on a controlled host already builds and releases reliably. Docker should solve a known boundary problem; without one, it is another layer to maintain.
Avoid containerising a stateful service without understanding its storage and recovery. The ability to start a second database container does not make the data consistent or highly available.
And do not adopt a cluster platform because the team has learned Docker. Image packaging and distributed orchestration are separate decisions with very different operating costs.
Use Docker when the image is a tested release boundary, not a substitute for operations.
I choose Docker when one immutable artefact moving through environments removes a real source of failure. I want the base image, privilege, resources, state and replacement process known before production. If the only benefit is that the application now starts through another command, I keep the deployment smaller.
Alexander De Sousa · Founder, Digital Royalty · LinkedIn
What remains outside the container image
Docker can package a repeatable process and its dependencies. Hosts, secrets, resources, durable data, traffic, monitoring and image replacement still need owners.
The Docker commitment in six decisions
- Best fit
- Applications whose dependency isolation, repeatable artefacts and deployment portability repay an image build and container operating model.
- Customer effect
- Consistent releases and faster replacement when state is external; restarts and data loss when container lifecycle is mistaken for service resilience.
- Adoption cost
- Moderate for build, registry and host operation; higher with multi-host orchestration, private networking, policy and several stateful services.
- Ongoing owner
- A platform or application team responsible for Dockerfiles, base images, registry, host, resources, secrets, storage, logs and redeployment.
- Exit cost
- Low for standard OCI images with external state; higher when deployments depend on a provider-specific orchestrator and networking model.
- Proof required
- Reproducible build, unprivileged start, enforced resource test, image replacement, durable-data recovery and rollback with the current schema.
Deployment routes to compare before containerising
-
Conventional host service
Right when: One controlled application deploys predictably and an extra packaging and registry layer would not reduce material risk.
Watch for: Keep runtime and packages reproducible so simplicity does not become manual host drift.
-
Docker Compose on a managed host
Right when: A small service set benefits from containers and the recovery objective permits explicit single-host replacement.
Watch for: Compose does not provide automatic cross-host failover; monitor and back up the host and durable volumes.
-
Managed container service
Right when: The team wants container scheduling and replacement while shifting host operation to a provider.
Watch for: Task networking, IAM, logs, scaling, image updates and provider costs remain part of application operation.
-
Kubernetes platform
Right when: A material multi-service estate and platform team need consistent scheduling, policy and extensible control across many workloads.
Watch for: Cluster, add-on, networking and upgrade work can outweigh the application estate it was introduced to support.
Research behind this Docker position
-
Official concepts
What is a container?
Defines isolated processes and image packaging while distinguishing containers from complete virtual machines.
-
Official build practice
Docker build best practices
Recommends trusted small bases, multi-stage builds, rebuilding, exclusions and pinned versions as parts of a controlled image supply chain.
-
Official security
Docker rootless mode
Shows how daemon and containers can run without root and documents constraints that need testing for the intended host.
-
Official capacity
Docker container resource constraints
Documents memory and CPU controls and the risks of unbounded memory consumption on the shared host.
-
Official deployment
Use Compose in production
Separates production configuration from development conveniences and identifies restart, port and code-mount considerations.
-
Supply-chain standard
SLSA build track
Provides an independent model for build provenance and integrity that can inform higher-assurance image pipelines.
-
Practitioner question
Stack Overflow: PID 1 and signal handling in Docker
The discussion exposes signal and child-process behaviour that affects graceful shutdown; current Docker and runtime guidance should set the implementation.
-
Community operations
Reddit: keeping Docker images updated
Operators compare notifications and automated replacement. It is anecdotal input for a policy that should retain testing and rollback.
Tell us what you need
A few quick questions, then a straight answer from a real person — usually within a few hours.
What happens next
- 1 We reply A real person reads your answers and gets back to you, usually within a few hours.
- 2 Questions or a short call If anything isn't clear, we ask by email or book a short call. Before any call we audit your website and make the quick fixes it finds, free.
- 3 Your fixed quote A clear, fixed price in writing, within 48 hours of any call. There is no obligation to go ahead.
Tell us what you're working on
Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.