Docker's Bold Move: Free Hardened Images and AI-First Development Tools
Docker is reinventing itself for the AI era—here's what you need to know and how to get started today.
Why This Matters: The Security-AI Convergence
Two massive shifts are happening simultaneously in software development:
Supply chain attacks are exploding. From SolarWinds to codecov, attackers are targeting the build pipeline. Your base container images are now a critical attack surface.
AI development is going mainstream. Every team wants LLMs in production, but running models locally requires expensive GPUs, and security teams are drowning in vulnerabilities.
Docker's latest announcements address both problems at once. They're making 1,000+ Docker Hardened Images (DHI) free and transparent while adding AI-focused features like Docker Offload and an embedded AI agent. This isn't just feature creep—it's a strategic pivot from pure containerization to becoming an AI development platform.
Here's your practical guide to using both.
Part 1: Switching to Docker Hardened Images
What Makes DHI Different
Docker Hardened Images aren't just "alpine with some patches." They're built on a secure supply chain foundation:
- Source-built by Docker: Not repackaged binaries—actual builds from verified source
- SLSA Build Level 3 attestation: Cryptographically signed provenance chains
- Continuous patching: Near-zero CVEs maintained through active monitoring and backporting
- Multi-distro support: Alpine and Debian—you don't have to switch ecosystems
- Transparent: Apache 2.0 licensed, open catalog
The catalog has grown from 1,000+ to over 2,000 hardened images, and they're now free under the DHI Community tier.
How to Switch Your Base Images
Before (vulnerable base image):
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "app.py"]
After (hardened base image):
# Pull from Docker's hardened catalog
FROM docker.io/docker/hardened-python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "app.py"]
The switch is often just a FROM line change. Docker maintains hardened versions of popular images:
docker/hardened-nginxdocker/hardened-redisdocker/hardened-postgresdocker/hardened-nodedocker/hardened-python
Verifying the Security Claims
Check the attestation before trusting:
# Verify the image attestation
docker buildx imagetools inspect docker/hardened-python:3.11-slim
# Check SBOM (Software Bill of Materials)
docker sbom docker/hardened-python:3.11-slim
# Verify vulnerabilities with Docker Scout
docker scout cves docker/hardened-python:3.11-slim
Hardening Your CI/CD Pipeline
Update your GitHub Actions to use hardened images:
# .github/workflows/build.yml
name: Build and Push
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker/hardened-python:3.11-slim
steps:
- uses: actions/checkout@v4
- name: Verify base image
run: docker scout cves ${{ env.BASE_IMAGE }}
- name: Build hardened image
run: |
docker build \
--attest type=provenance,mode=max \
--attest type=sbom \
-t myapp:${{ github.sha }} .
Part 2: Docker Offload for AI Workloads
The Problem with Local LLMs
Running LLMs locally is painful:
- Hardware costs: A decent GPU costs $2,000+
- Power consumption: Your laptop becomes a space heater
- Model management: Different models need different runtimes
- Memory constraints: Large models OOM on consumer hardware
What Docker Offload Does
Docker Offload lets you:
- Run containers locally (everything feels local)
- Offload compute-intensive workloads (like LLM inference) to cloud GPUs
- Pay only for what you use ($0.015 per GPU minute in beta)
Think of it as "Docker Compose for GPU workloads"—you write the same docker-compose.yml, but compute runs in Docker's cloud.
Setting Up Docker Offload
# Enable Docker Offload (Docker Desktop 4.39+)
docker offload enable
# Check your GPU quota
docker offload status
Running Your First AI Model
docker-compose.yml for LLM inference:
services:
llm:
image: docker/llm-llama3:latest
ports:
- "8000:8000"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
environment:
- MODEL_PATH=/models/llama3-70b
- GPU_MEMORY_UTILIZATION=0.9
offload: cloud # This is the magic line
# Start the service with cloud GPU offload
docker compose up --offload
# The container runs locally, but LLM inference happens in Docker's cloud
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama3-70b",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Using Docker Model Runner
For even simpler model management, Docker introduced Docker Model Runner (DMR):
# Pull a model like you would a container image
docker model pull llama3:70b
# Run inference locally (with GPU) or via Offload
docker model run llama3:70b --prompt "Explain containerization"
# Serve via OpenAI-compatible API
docker model serve llama3:70b --port 11434
Part 3: The Docker AI Agent ("Ask Gordon")
What It Does
Docker Desktop 4.39 introduced "Ask Gordon"—an AI agent embedded in both Docker Desktop and the CLI. It can:
- Generate Dockerfiles from natural language
- Debug container issues
- Explain complex compose files
- Generate Kubernetes manifests
- Manage your local Docker resources
Using the AI Agent in the CLI
# Ask Gordon to generate a Dockerfile
docker ai "Create a Dockerfile for a FastAPI app with PostgreSQL"
# Debug a failing container
docker ai "Why is my container in restart loop?"
# Optimize your compose file
docker ai "Review my docker-compose.yml and suggest security improvements"
Example output:
# Generated by Docker AI Agent
FROM docker/hardened-python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY . .
# Non-root user for security
RUN useradd --create-home --shell /bin/bash appuser
USER appuser
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
Multi-Step Workflows
The agent can handle complex, multi-step requests:
docker ai "Set up a development environment with:
- PostgreSQL database
- Redis cache
- FastAPI backend
- React frontend
- All networks and volumes"
Gordon will generate a complete docker-compose.yml and explain each component.
Part 4: Real-World Scenarios
Scenario 1: Enterprise Security Team
Your CISO just mandated "zero CVEs in production base images."
The old way: Manually audit Alpine/Debian images, create internal hardening repo, maintain patches forever.
The Docker way:
# Audit your current images
docker scout cves myapp:latest
# Find hardened equivalents
docker search docker/hardened- --limit 50
# Switch and verify
FROM docker/hardened-nginx:1.25
# Document compliance
docker sbom docker/hardened-nginx:1.25 > sbom.json
Compliance teams get:
- SLSA Level 3 attestations
- Cryptographic provenance chains
- CVE remediation SLAs (Enterprise tier)
Scenario 2: AI Startup on a Budget
You're building an AI app but can't afford $10,000 in GPU hardware.
The old way: Rent AWS p3.2xlarge instances at $3/hour, manage GPU drivers, debug CUDA version conflicts.
The Docker way:
# docker-compose.yml
services:
app:
build: .
ports: ["8000:8000"]
model:
image: docker/llm-llama3:latest
offload: cloud # Only pay when inference runs
docker compose up --offload
# Cost: $0.015/GPU-minute during active inference
# Local development still feels instant
Scenario 3: CI/CD Hardening
Your build pipeline uses random base images from Docker Hub.
The hardened pipeline:
# .github/workflows/build.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use hardened base
run: |
BASE_IMAGE=docker/hardened-node:20-slim
docker pull $BASE_IMAGE
- name: Security scan
run: docker scout cves $BASE_IMAGE --only-severity critical,high
- name: Build with attestations
run: |
docker buildx build \
--sbom \
--provenance mode=max \
-t myapp:${{ github.sha }} .
Part 5: FAQ
Is DHI Community really free?
Yes. All 2,000+ images are Apache 2.0 licensed. No catch. The paid tiers (DHI Select at $5K/repo, DHI Enterprise) add SLA guarantees and extended support.
What's the catch with Docker Offload?
During beta, you get free GPU minutes to start. After that, it's $0.015/minute. For a 70B parameter model, that's cheaper than renting equivalent GPU instances directly—and you don't manage infrastructure.
Will hardened images slow down my builds?
No. They're minimal images optimized for production. Build times are similar to Alpine/Debian slim variants. You might even see faster builds since you're not pulling unnecessary packages.
Can I use Docker Offload with existing containers?
Yes. Add offload: cloud to any service in your docker-compose.yml. Docker handles the migration transparently.
Does the AI agent send my code to Docker?
The agent runs locally for most operations. When using cloud models for complex generation, your prompts go through Docker's inference endpoints. Check Docker's privacy policy for details.
What about SBOM and provenance?
Every DHI image includes:
- Software Bill of Materials (SBOM)
- SLSA Level 3 provenance attestation
- Cryptographic signatures
You can verify these with docker sbom and docker buildx imagetools inspect.
Conclusion: Where Docker Is Heading
Docker's announcements signal a clear strategy:
- Security by default—hardened everything, transparent supply chains
- AI-first tooling—Offload, Model Runner, and embedded AI agents
- Developer experience—same Docker commands, more powerful results
The days of "it works on my machine" are evolving into "it's secure on my machine, and it scales to the cloud."
Action Items for This Week
-
Audit your base images: Run
docker scout cveson your top 5 production images -
Switch one service to DHI: Pick a non-critical service, change the
FROMline, verify it works -
Try Docker Offload: Enable it, run
docker model pull llama3:8b, test inference -
Experiment with the AI agent: Ask Gordon to review your current
docker-compose.yml
The tools are free. The security is real. The AI capabilities are here. Time to update your Dockerfile.
Have you tried DHI or Docker Offload? Share your experience in the comments.
Top comments (0)