Skip to content
Bibo Hao edited this page Jul 2, 2026 · 3 revisions

name: labnow-docker description: Guidelines, architectures, and build scripts for LabNow Docker container images (including Atom base, Python/Mamba environment, Core language profiles, CUDA/GPU, and Postgres extensions).

LabNow Docker Build Skill

This skill documents and encapsulates the design patterns, style guidelines, and technical architectures of the lab-foundation Docker container build system.

Image Hierarchy

The LabNow Docker ecosystem uses a highly optimized, layered architecture to maximize Docker cache reuse and keep image sizes minimal.

graph TD
    ubuntu["Ubuntu 24.04 (Noble)"] --> Atom["atom (OS Setup, Locales, Sudo, shell-utils)"]
    Atom --> Base["base (Python, Conda, Micromamba, Tini, uv)"]
    Base --> Core["core (Profile-based Node, Java, Go, Rust, Julia, R, LaTeX)"]
    Base --> DockerKit["docker-kit (Docker Compose, image-syncer, yq)"]
    
    cuda["NVIDIA CUDA Devel"] --> AtomGPU["nvidia-cuda atom wrapper"]
    AtomGPU --> BaseGPU["nvidia-cuda base wrapper"]
    BaseGPU --> CudaBase["cuda (nvtop, system python wrap)"]
    CudaBase --> CoreCUDA["core-cuda / GPU frameworks (PyTorch, TF, Paddle)"]
    
    postgres["PostgreSQL 16"] --> PostgresExt["postgres-ext (pgxman, pgxnclient, compiled extensions)"]
Loading

Design Principles & Style Conventions

When building or modifying LabNow Dockerfiles, adhere to the standard style guides. Detailed rules on instruction casings, layer caching optimizations, package management loops, and temporary development headers cleanups can be found in the:

  • Dockerfile Specification, Style & Best Practices Guide

Common patterns:

  • Layer Cache Optimization: Always chain installation commands and follow immediately with install__clean in the same RUN instruction.
  • Sourced Helpers: Copy utility scripts to /opt/utils/ and source /opt/utils/script-utils.sh to leverage functions like install_apt, install_pip, and fix_permission.
  • Login Shell Sourcing: Use SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"] to load environmental profiles correctly.

Skill Submodules

This skill is split into the following technical submodules under the references/ directory:

  • Dockerfile Specification, Style & Best Practices Guide: Rules and constraints governing instruction capitalization, cache optimizations, dependency indexing, and loops.
  • Base System Image Setup (Atom & Base): Details on OS setup, locale configurations, regional mirrors optimization (script-localize.sh), Micromamba/Conda bootstrapping, and OS python replacement.
  • Core Languages Stack & Profiles: Custom profile installations for Node/Bun/pnpm, Java/Maven, Go, Rust, Julia, R, Octave, and LaTeX.
  • GPU & CUDA Integration: Nvidia CUDA wrapping strategy, GPU runtime utilities (nvtop), and PyTorch/TensorFlow/Paddle installation matching specific CUDA index wheels.
  • PostgreSQL Database Extensions: PG extension installation via package managers (pgxman, pgxnclient) and custom source compiles (pg_search, pgroonga, pgvectorscale, etc.).
  • CI/CD Pipelines & Orchestration: Details on tool.sh CLI wrapper, dynamic branch-based tag namespaces, GHA workflows, and cross-registry mirror synchronization using image-syncer.

Clone this wiki locally