Sign inSign up

phygrid/cuda-base

By phygrid

โ€ขUpdated about 1 year ago

Common CUDA base image for AI inference services with multi-architecture support

Image
0

2.4K

phygrid/cuda-base repository overview

โ Phygrid CUDA Base Image

Docker Hub Docker Image Version Build Status License

A multi-architecture Docker base image optimized for AI inference services, providing common system dependencies and Python packages for CUDA-accelerated applications. Supports both Intel/AMD x64 systems and ARM64 NVIDIA Jetson devices.

โ ๐Ÿš€ Quick Start

# Pull the latest image
docker pull phygrid/cuda-base:latest

# Use as base image in your Dockerfile
FROM phygrid/cuda-base:1.0.0

โ ๐Ÿ“‹ What's Included

โ System Dependencies
  • Build tools: build-essential, cmake, git, wget, curl
  • Audio processing: libasound2-dev, portaudio19-dev, libsndfile1, ffmpeg
  • Image processing: libgl1, libglib2.0-0, OpenCV dependencies
  • Security: patchelf for executable stack fixes
  • Networking: ca-certificates and utilities
โ Python Environment
  • Base: Python 3.11 with optimized pip, setuptools, wheel
  • Web frameworks: FastAPI 0.104.1, Uvicorn, Pydantic 2.5.0
  • Core libraries: NumPy 1.24.4, Pillow 10.1.0, Requests 2.31.0
  • Utilities: aiofiles, python-dotenv, python-multipart
โ Container Features
  • Security: Non-root appuser with proper permissions
  • Structure: Pre-created /app/{cache,models,data,logs} directories
  • Health check: Built-in health check endpoint
  • Multi-arch: AMD64 (Intel/AMD) and ARM64 (NVIDIA Jetson) support
  • CUDA: GPU acceleration for NVIDIA Blackwell and earlier architectures
  • Port: Exposes port 8000 (customizable)

โ ๐Ÿณ Docker Hub

Repository: phygrid/cuda-baseโ 

โ Available Tags
  • latest - Latest stable release
  • 1.0.0, 1.0.1, etc. - Specific semantic versions
  • Multi-architecture support: linux/amd64, linux/arm64

โ ๐Ÿ“ฆ Usage Examples

โ As Base Image
FROM phygrid/cuda-base:1.0.0

# Copy your application
COPY . /app/

# Install additional dependencies
RUN pip install -r requirements.txt

# Override default command
CMD ["python", "main.py"]
โ Development Environment
# Run interactive container
docker run -it --rm \
  -v $(pwd):/app/workspace \
  -p 8000:8000 \
  phygrid/cuda-base:latest \
  bash
โ Production Deployment
# Run with GPU support (Intel/AMD systems)
docker run -d \
  --name my-ai-service \
  --gpus all \
  -p 8000:8000 \
  -v /data:/app/data \
  phygrid/cuda-base:latest

# Run on NVIDIA Jetson devices
docker run -d \
  --name my-ai-service \
  --runtime nvidia \
  --gpus all \
  -p 8000:8000 \
  -v /data:/app/data \
  phygrid/cuda-base:latest

โ ๐Ÿ—๏ธ Building from Source

# Clone repository
git clone https://github.com/phygrid/cuda-base.git
cd cuda-base

# Build image
docker build -t phygrid/cuda-base:custom .

# Build for multiple architectures
docker buildx build --platform linux/amd64,linux/arm64 -t phygrid/cuda-base:custom .

โ ๐Ÿ”„ Versioning

This project uses automated semantic versioning:

  • Automatic: Patch versions increment on main branch changes
  • Manual: Edit VERSION file for major/minor bumps
  • Tags: Git tags created automatically (e.g., v1.0.0)

See DOCKER_DEPLOYMENT.mdโ  for detailed deployment workflow.

โ ๐Ÿงช Health Check

The image includes a built-in health check:

# Test health endpoint
docker run --rm phygrid/cuda-base:latest python /app/health_check.py

โ ๐Ÿค Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request
โ Development Setup
# Clone and setup
git clone https://github.com/phygrid/cuda-base.git
cd cuda-base

# Test build locally
docker build -t phygrid/cuda-base:test .
docker run --rm phygrid/cuda-base:test python /app/health_check.py

โ ๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSEโ  file for details.

โ ๐Ÿ”ง Environment Variables

VariableDefaultDescription
PYTHONUNBUFFERED1Disable Python output buffering
PYTHONDONTWRITEBYTECODE1Don't write .pyc files
PIP_NO_CACHE_DIR1Disable pip cache
PIP_DISABLE_PIP_VERSION_CHECK1Skip pip version checks

โ ๐Ÿท๏ธ Labels

The image includes standard OCI labels:

LABEL org.opencontainers.image.title="Phygrid CUDA Base"
LABEL org.opencontainers.image.description="Common CUDA base image for AI inference services"
LABEL org.opencontainers.image.vendor="Phygrid"
LABEL org.opencontainers.image.version="1.0.0"

โ ๐Ÿ†˜ Support

โ ๐Ÿ“ˆ Metrics

  • Image size: ~800MB compressed (AMD64), ~1.2GB (ARM64 with CUDA)
  • Build time: ~5-10 minutes (with cache)
  • Architectures: AMD64 (Intel/AMD), ARM64 (NVIDIA Jetson)
  • Python version: 3.12 (Ubuntu 24.04 default)
  • Base OS: Ubuntu 24.04 + CUDA 13.0 (unified for both architectures)
  • CUDA version: 13.0.0 with compatibility layer for edge deployment

Tag summary

Content type

Image

Digest

sha256:96aa88d0bโ€ฆ

Size

17.3 GB

Last updated

about 1 year ago

docker pull phygrid/cuda-base