Meet YOLO26: next-gen vision AI.
Ultralytics
Back to Ultralytics Glossary

Docker

Explore how Docker enables reproducible AI deployment. Learn to package Ultralytics YOLO26 models in containers for seamless scaling from cloud to edge devices.

Docker is an open-source platform that enables developers to automate the deployment, scaling, and management of applications using containerization. In the context of artificial intelligence and machine learning, Docker acts as a standardized unit of software that packages code and all its dependencies—such as libraries, system tools, and settings—so the application runs quickly and reliably from one computing environment to another. This eliminates the common "it works on my machine" problem, ensuring that a neural network trained on a researcher's laptop behaves exactly the same way when deployed to a massive cloud server or an edge device.

Link to this sectionWhy Docker Matters for AI and Machine Learning#

Modern machine learning operations (MLOps) rely heavily on reproducibility and portability. An AI project often involves a complex stack of software, including specific versions of Python, CUDA drivers for GPU acceleration, and deep learning frameworks like PyTorch or TensorFlow. Managing these manually across different teams and infrastructure is error-prone.

Docker simplifies this by creating lightweight, standalone containers. Unlike traditional virtual machines (VMs) that require a full operating system for each instance, containers share the host machine's OS kernel but run in isolated user spaces. This makes them significantly more resource-efficient and faster to start, which is critical when scaling model serving infrastructure or running distributed training jobs.

Link to this sectionReal-World Applications#

Docker is ubiquitous in the AI lifecycle, from initial experimentation to final deployment.

  1. Consistent Training Environments: A data science team might use Docker images to share a unified development environment. For instance, a researcher working on object detection can pull a pre-built image containing all necessary drivers and libraries. This ensures that when they train a YOLO26 model, the results are reproducible by their colleagues, regardless of the underlying hardware differences.

  2. Edge AI Deployment: In smart city surveillance, updated models need to be pushed to thousands of edge devices, such as traffic cameras or drones. Docker containers allow engineers to package a new model version and deploy it over the air. Because the container includes the inference runtime, the update process is seamless and does not interfere with the device's core operating system.

Link to this sectionDocker vs. Kubernetes vs. Virtual Machines#

It is helpful to distinguish Docker from related technologies to understand its specific role:

  • Docker vs. Virtual Machines (VMs): VMs virtualize the hardware, meaning each VM runs a full OS (like Windows or Linux) on top of a hypervisor. This consumes significant memory and CPU. Docker virtualizes the operating system, making containers much smaller and faster than VMs.
  • Docker vs. Kubernetes: These are complementary, not competing, technologies. Docker is the tool used to create and run individual containers. Kubernetes is a container orchestration platform that manages clusters of Docker containers, handling tasks like auto-scaling, load balancing, and self-healing in large-scale cloud computing environments.

Link to this sectionExample: Running Inference in a Container#

The following example demonstrates how a Python script might look inside a Docker container designed for computer vision. This script uses the ultralytics package to load a model and perform inference. The container environment ensures that the correct dependencies (like opencv-python and torch) are already present.

from ultralytics import YOLO

# Load the YOLO26 model (weights are typically included in the Docker image)
model = YOLO("yolo26n.pt")

# Perform inference on an image source
# In a containerized microservice, this might process incoming API requests
results = model.predict("https://ultralytics.com/images/bus.jpg")

# Log the detection results
print(f"Detected {len(results[0].boxes)} objects in the image.")

Link to this sectionIntegrating Docker into Your Workflow#

To get started with containerization, developers typically define a Dockerfile, which is a text document containing all the commands to assemble an image. Once built, these images can be stored in registries like Docker Hub or the NVIDIA NGC Catalog, which offers GPU-optimized containers.

For those looking to streamline the training and deployment process without manually managing Dockerfiles, the Ultralytics Platform offers integrated tools that handle the complexity of cloud environments. This allows users to focus on improving model accuracy rather than configuring infrastructure. Furthermore, you can explore our Docker Quickstart Guide to learn how to run Ultralytics models in containers immediately.

Explore solutions

Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning