💾 Storage Configuration
Configure Storage (Stage-2's dynamic system) and Mounts (general volume mounts) for both stages.
📋 Key Concepts:
Storage is Stage-2's unique dynamic system for predefined directories (/soft/app, /soft/data, /soft/workspace).
Mounts are general volume mounts that can be defined for any container path.
🚀 Stage-2 Dynamic Storage System (Stage-2 ONLY)
Stage-2's unique dynamic storage for predefined directories with smart linking: /soft/xxx → /hard/volume/xxx OR /hard/image/xxx
Application files and dependencies
User data and persistent files
Development and workspace files
Host directory path
🏗️ Stage-1 Mounts (General Volume Mounts)
Configure Stage-1 Mounts
General volume mounts for Stage-1 image (any paths, user-defined)
➕ Add New Stage-1 Mount
Name for this mount configuration (used in YAML)
Path inside the container where the volume will be mounted
Name of the Docker volume
📋 Current Stage-1 Mounts
cache_mount: /var/cache/apt
Auto Volume
workspace_mount: /workspace → /home/user/code
Host Directory
bad_mount: /invalid/path → /nonexistent
Host Directory - Path does not exist
🚀 Stage-2 Mounts (General Volume Mounts)
Configure Stage-2 Mounts
General volume mounts for Stage-2 image (any paths, user-defined)
⚠️
Important: Stage-2 mounts don't inherit from Stage-1.
You must redefine any needed mounts for Stage-2.
📊 Storage & Mount Configuration Summary
Stage-2 Dynamic Storage
Smart Linking System:
/soft/app → /hard/image/app
/soft/data → /hard/volume/data
/soft/workspace → /hard/volume/workspace
(Links automatically to volume or in-image)
Stage-1 Mounts
-v cache_mount_vol:/var/cache/apt
-v /home/user/code:/workspace
-v /nonexistent:/invalid/path
(General volume mounts)
Stage-2 Mounts
-v /home/user/data:/home/me
(Don't inherit from Stage-1)
YAML Configuration Preview
stage_2:
storage:
app: { type: image }
data: { type: auto-volume }
workspace: { type: host, host_path: "/home/user/workspace" }
mount:
user_home: { type: host, dst_path: "/home/me", host_path: "/home/user/data" }
❌
Validation Errors
• Host directory /nonexistent does not exist
• Mount path /invalid/path contains invalid characters
💡 Storage & Mount Best Practices
Storage (Stage-2 ONLY): Use 'image' for apps, 'auto-volume' for data, 'host' for development
Auto Volumes: Best for temporary data that doesn't need to persist outside Docker
Manual Volumes: Good for shared data between containers or persistent storage
Host Directories: Ideal for development when you need direct file access from host
Mount Inheritance: Stage-2 mounts don't inherit from Stage-1, must be redefined