RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Troubleshooting Local AI
  6. /Ch. 8
Troubleshooting Local AI

08. Docker Issues

Chapter 8 of 15 · 15 min
KEY INSIGHT

Docker layer caching means builds reuse unchanged layers. After modifying `requirements.txt`, only layers after that line rebuild. Use `--no-cache` only when debugging layer-specific failures.

GPU Passthrough Failures

# Verify NVIDIA runtime is Docker's default
docker info | grep -i nvidia
# Should output: "Default Runtime: nvidia"

# If not, create /etc/docker/daemon.json
sudo tee /etc/docker/daemon.json <<EOF
{
    "default-runtime": "nvidia",
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
EOF
sudo systemctl restart docker

Volume Mount Failures

Models stored on the host must be mounted into the container:

# Correct: mount the directory containing the model
docker run -v /home/user/models:/models your-image python generate.py --model /models/llama-2-7b

# Incorrect: mounting a single file can cause permission issues
docker run -v /home/user/models/llama-2-7b/config.json:/config.json your-image

Image Build Failures

# Build with build arguments matching host CUDA version
docker build \
  --build-arg CUDA_VERSION=12.1 \
  --build-arg TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9;9.0" \
  -t your-model-image .

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Build a Docker image with a simple Python inference script. Verify GPU access inside the container with nvidia-smi. Commit the image, push it to a registry, and pull it on a different machine to confirm reproducibility.

← Chapter 7
API Connection Refused
Chapter 9 →
WSL2 Problems