Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AI Builder Club Skills Docker

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Dev_Environments
Last Updated 2026-10-24 00:00 GMT

Overview

Docker container runtime environment for running infrastructure services (databases, caches) and managing isolated dev stacks on cloud boxes.

Description

This environment provides the Docker daemon (dockerd) for running containerized infrastructure services. The setup.sh boot script checks if Docker is running, starts dockerd if not, waits for readiness, and fixes socket permissions. The dev-local.sh template optionally starts infra containers (Redis, Postgres, Supabase) via Docker. On crabbox cloud boxes, Docker is the substrate for all service containers.

Usage

Use this environment for Parallel Isolation (cloud box stacks via setup.sh) and Dev Stack Automation (infra containers via dev-local.sh). The NEEDS_DOCKER=1 flag in setup.sh controls whether the Docker startup phase runs.

System Requirements

Category Requirement Notes
OS Linux (native), macOS (Docker Desktop), Windows (WSL2) dockerd runs natively on Linux
Hardware 4GB+ RAM Containers share host memory
Disk 10GB+ free space Container images and volumes

Dependencies

System Packages

  • docker (Docker Engine >= 20.0)
  • dockerd daemon (or Docker Desktop on macOS)
  • sudo access (for socket permissions and daemon startup)

Python Packages

  • None

Credentials

No credentials required for local dev. Cloud box deployments may require registry credentials injected via .env.

Quick Install

# macOS
brew install --cask docker

# Ubuntu/Debian
curl -fsSL https://get.docker.com | sh

# Verify
docker info

Code Evidence

Docker readiness check from setup.sh:29-36:

if docker info >/dev/null 2>&1; then
  echo "[setup] docker already up"
else
  echo "[setup] starting docker daemon…"
  sudo dockerd >/tmp/dockerd.log 2>&1 &
  for i in $(seq 1 40); do docker info >/dev/null 2>&1 && break; sleep 1; done
  docker info >/dev/null 2>&1 || { echo "[setup] dockerd failed"; tail -30 /tmp/dockerd.log; exit 1; }
fi
sudo chmod 666 /var/run/docker.sock 2>/dev/null || true

Docker guard in dev-local preflight from dev-local.template.sh:54-55:

# If infra needs Docker, uncomment:
# command -v docker >/dev/null 2>&1 || die "docker not found."
# docker info >/dev/null 2>&1 || die "Docker daemon not running. Start Docker Desktop."

Common Errors

Error Message Cause Solution
[setup] dockerd failed Docker daemon could not start Check /tmp/dockerd.log for details; ensure no conflicting daemon is running
permission denied while trying to connect to the Docker daemon socket Socket permissions sudo chmod 666 /var/run/docker.sock (script does this automatically)
Cannot connect to the Docker daemon Docker Desktop not running (macOS) Start Docker Desktop application

Compatibility Notes

  • macOS: Requires Docker Desktop; dockerd runs inside a VM.
  • Linux (cloud box): dockerd starts directly via sudo dockerd; the script handles this.
  • Windows: Use WSL2 with Docker Desktop's WSL2 backend.
  • Rootless mode: The chmod 666 /var/run/docker.sock step may not be needed in rootless Docker setups.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment