Docker
Docker is an open platform for building, shipping, and running applications in containers: lightweight, isolated environments that package an application together with everything it needs to run.[2] Solomon Hykes, Docker's founder, first demonstrated it publicly at PyCon on March 15, 2013.[1]
What does Docker mean in simple terms?
Many teams know the problem "it works on my machine but not on the server." The cause is usually a different environment: another library version, another OS setting. Docker packages the code, its libraries, and its settings into one container image, so the app does not depend on what happens to be installed on the host.[2] The same container can run on a developer laptop, on servers in a company data center, or with a cloud provider.[2] Docker says it is used by more than 20 million developers.[10] For AI work, this means a model server or a data pipeline can be handed to a colleague as an image instead of a long setup guide.
How can Docker be explained with an analogy?
Docker is like a meal kit box that holds the ingredients, the recipe, and the cooking tools. Carry it to any kitchen and you can cook the same dish.
Where is Docker used?
Hugging Face Spaces — Custom AI apps as Docker containers
Hugging Face Spaces lets users host demo apps. Besides Gradio, a Space can be built from a regular Dockerfile, which allows apps such as FastAPI endpoints or MLOps tools.[7] For GPU hardware, Hugging Face recommends the nvidia/cuda base image from Docker Hub, which ships with CUDA and cuDNN preinstalled. It also notes that no GPU is available while the image is being built, so GPU commands must run only at runtime.[7]
Result: The Dockerfile in the repository defines the app's whole environment, so the same app can be rebuilt the same way.[7]
Hugging Face Text Generation Inference — Serving an LLM with one command
Hugging Face's Text Generation Inference (TGI) documentation states that the easiest way to start is the official Docker container.[8] The quick tour serves an open 7B model on an NVIDIA GPU with a single docker run command that passes the model ID, and shares a local folder with the container so the model weights are not downloaded on every run.[8] Once running, the server can be called through an OpenAI Chat Completions-compatible Messages API.[8]
Result: With compatible GPU hardware and drivers in place, the documented container command can start an LLM server.[8]
Case 3 (hypothetical example): A small team standardizing its development setup
This is an illustrative scenario, not a real company. A five-person startup keeps losing time when new members install Python, a database, and a vector store with slightly different versions. The team writes one Dockerfile for the app and a Docker Compose file for the supporting services, so a new member starts everything with a single command.[2] Containers become the unit for sharing, testing, and deploying the app, in line with the workflow Docker describes.[2]
Result: Illustrative only; actual time savings depend on the team and are not measured here.
Why it matters in the AI era
- Reproducible AI environments. A container image fixes library versions, which helps reproduce a model service on compatible machines. GPU projects can start from a base image with CUDA and cuDNN already installed.[7] The host still needs a compatible GPU and drivers.
- A basic unit for CI/CD and orchestration. Docker describes containers as the unit for distributing and testing applications and as a good fit for CI/CD.[2] Kubernetes runs images built with Docker on all of its supported runtimes.[5]
- Low cost to start. Docker Engine is an open-source project.[3] Docker Desktop is free for personal use, education, non-commercial open-source projects, and small businesses with fewer than 250 employees and less than USD 10 million in annual revenue.[3] Docker Model Runner, introduced in April 2025, lets developers pull and run AI models locally with Docker tooling.[9]
Try it today
- Install Docker Desktop and check whether your organization needs a paid subscription under the license terms.[3]
- Run one official image, such as a database you already use, instead of installing it directly.
- Write a short Dockerfile for one internal script and ask a colleague to run it on their machine.
- Try running a small open model locally with Docker Model Runner, keeping company data out of experiments until your security rules allow it.[9]
Limits and direction
Containers are only "loosely isolated" from the host, so they are not a full security boundary on their own.[2] Large organizations and government entities need a paid subscription to use Docker Desktop.[3] Docker is also not the only container runtime: Kubernetes removed its built-in Docker Engine integration (dockershim) in v1.24, while images built with Docker continue to work.[5][6] Docker is now extending its tools toward local AI model execution, packaging models as OCI artifacts that move through the same registries as container images.[9]
How has Docker evolved?
Which concepts are related to Docker?
- OrchestrationKubernetesA system for running and managing containers at scale; images built with Docker run on it.[5]
- Core conceptContainerDocker is a widely used platform for building and running containers.[2]
Which sources explain Docker?
- Docker — Docker: Nine Years YOUNG (2022-03-15) — https://www.docker.com/blog/docker-nine-years-young/
- Docker Docs — What is Docker? — https://docs.docker.com/get-started/docker-overview/
- Docker Docs — Docker Desktop license agreement — https://docs.docker.com/subscription-billing/desktop-license/
- Kubernetes — 10 Years of Kubernetes (2024-06-06) — https://kubernetes.io/blog/2024/06/06/10-years-of-kubernetes/
- Kubernetes — Don't Panic: Kubernetes and Docker (2020-12-02) — https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/
- Kubernetes — Updated: Dockershim Removal FAQ (2022-02-17) — https://kubernetes.io/blog/2022/02/17/dockershim-faq/
- Hugging Face — Docker Spaces (Hub documentation) — https://huggingface.co/docs/hub/spaces-sdks-docker
- Hugging Face — Text Generation Inference: Quick Tour — https://huggingface.co/docs/text-generation-inference/quicktour
- Docker — Introducing Docker Model Runner (2025-04-09) — https://www.docker.com/blog/introducing-docker-model-runner/
- Docker — About Docker — https://www.docker.com/company/
Tell us what you think
Your feedback helps us improve the content.