Setting Up and Using External Drives with Colima and Docker on a Mac Mini


Part 1: Mount External Drive(s) on the Mac

  1. Physically connect the drives (NAS and SSD) to your Mac Mini.
  2. Mount a NAS network share if needed:
    • Finder ➔ Go > Connect to Server
    • Example: smb://your-nas-ip-address/ShareName
    • Authenticate and mount.
  3. Check mount points:
    ls /Volumes
    
    • You should see /Volumes/MediaAssets (NAS) and /Volumes/SSDMediaManager (SSD).

Part 2: Configure Colima to See Those Drives

  1. Edit your Colima config file:
    vim ~/.colima/default/colima.yaml
    
  2. Ensure it includes:
    mountType: virtiofs
    
    mounts:
      - location: /Users
        writable: true
      - location: /Volumes/MediaAssets
        writable: false
      - location: /Volumes/SSDMediaManager
        writable: true
    

Part 3: Reset Colima to Apply Config

  1. Reset Colima cleanly:
    colima stop
    colima delete --force
    colima start --mount-type virtiofs
    

Part 4: Confirm Colima Setup

  1. Check Colima status:
    colima status --json
    
    • Confirm you see "mount_type": "virtiofs".

Part 5: Make Drives Accessible to Docker Containers

  1. When running containers, explicitly mount drives:
    docker run --rm -it \
      -v /Users:/Users \
      -v /Volumes/MediaAssets:/nas:ro \
      -v /Volumes/SSDMediaManager:/ssd:rw \
      alpine sh
    

Part 6: Mount Drives with the App via Docker Compose

  1. In your future docker-compose.yml:
    services:
      app:
        volumes:
          - /Volumes/MediaAssets:/nas:ro
          - /Volumes/SSDMediaManager:/ssd:rw
    
  • /nas becomes the source (read-only).
  • /ssd becomes the working directory (read-write).

Part 7: Ensure Mounts Survive Mac Reboots

  1. Persistence requirements:
  • Ensure the drives auto-mount at Mac login:
    • For NAS: Add the mounted share to Login Items in System Settings.
    • For SSD: Keep physically connected ➔ MacOS will remount.
  1. After a reboot:
    • Confirm /Volumes/MediaAssets and /Volumes/SSDMediaManager exist.
    • Then start Colima:
       colima start
      
  2. Containers and devcontainers will work normally if mounts exist.

Final Notes:

  • No re-editing of colima.yaml needed after reboot.
  • If drives are missing at startup, mount them first, then start Colima.
  • Docker Compose or container -v bindings are mandatory for apps to access mounted storage.

Full flow:

  • Mac ➔ Mount drives
  • Colima ➔ Sees drives via virtiofs
  • Docker ➔ Binds drives into containers
  • App ➔ Works off /nas and /ssd

Reliable and repeatable after reboot.

Visit Emlekezik.com