Engineering
What Is Docker?
A way to package an application with its dependencies so it runs the same on a laptop, in CI and in production.
Definition
Docker is a platform for building and running containers. A container packages an application together with its libraries and system dependencies, and runs as an isolated process on a shared host kernel. The package is defined by a Dockerfile and built into an image, which can be run identically anywhere a container runtime exists.
Containers are not virtual machines
A virtual machine virtualises hardware and runs a full guest operating system. A container shares the host kernel and isolates only the process and its filesystem. That makes containers start in a fraction of a second and use far less memory, at the cost of weaker isolation than a VM provides.
Why it matters for data and crawling work
Tools such as headless browsers pull in a long list of system libraries, and browser binaries are version pinned to the driver that launches them. Pinning those inside an image removes an entire class of failure where a job runs locally and fails on the server.
Practical guidance
- Pin base image versions rather than relying on the latest tag
- Order Dockerfile layers so dependency installation is cached separately from source
- Use multi stage builds so build tooling does not ship in the final image
- Keep secrets out of images, injecting them at runtime instead
- Run as a non root user where the workload allows it
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.