Skip to content

jiraguha/dock

Repository files navigation

       _            _
    __| | ___   ___| | __
   / _` |/ _ \ / __| |/ /
  | (_| | (_) | (__|   <
   \__,_|\___/ \___|_|\_\

dock

Disposable Remote Development Environments

Your laptop stays cool. Your cloud does the work.

License: MIT Tests Release Maturity Security Bun Terraform Scaleway


Create | Work | Stop | Resume | Destroy

Zero local resource consumption. Full control. Pay only for what you use.

Alt

Why dock?

Running Docker and Kubernetes locally drains your battery, spins up fans, and turns your laptop into a space heater. dock moves all that to a remote VM you fully control.

Local Dev dock
CPU usage High Zero
Battery drain Yes No
Fan noise Loud Silent
Cost when idle N/A $0
Reproducible Maybe Always

Quick Start (5 minutes)

1. Install dock

curl -fsSL https://raw.githubusercontent.com/jiraguha/dock/main/install.sh | bash

2. Configure credentials

dock env --set SCW_ACCESS_KEY=SCWXXXXXXXXX,SCW_SECRET_KEY=xxx-xxx-xxx,SCW_PROJECT_ID=xxx-xxx-xxx

Or create ~/.dock/.env:

mkdir -p ~/.dock
cat > ~/.dock/.env << 'EOF'
SCW_ACCESS_KEY=SCWXXXXXXXXXXXXXXXXX
SCW_SECRET_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SCW_PROJECT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
EOF

3. Create your environment

dock create

That's it! Auto-pilot mode handles SSH multiplexing, port forwarding, and environment setup automatically.

4. Start working

dock ssh                    # SSH into your environment
docker ps                   # Docker works automatically
kubectl get nodes           # Kubernetes works automatically

CLI Output Examples

Status

dock ⛴  Environment Status
─────────────────────────────────────
  State:       🟢 running
  Instance:    DEV1-M
  Zone:        fr-par-1
  IP:          163.172.189.201
  Uptime:      2h 34m
  Branch:      root/main
─────────────────────────────────────
  Docker:      ✓ connected
  Kubernetes:  ✓ k3s (6 pods)
  SSH:         ✓ master active
  Ports:       3000, 8080, 5432
─────────────────────────────────────

Create

🚀 Creating environment

  ✓ Terraform initialized
  ✓ Instance provisioned (DEV1-M, fr-par-1)
  ✓ SSH available at 163.172.189.201
  ✓ Docker configured
  ✓ Kubernetes ready (k3s)
  ✓ Port forwarding active

✅ Environment created in 00:02:41

Destroy

⚠️  Destroy environment?

  Instance     DEV1-M
  Zone         fr-par-1
  IP           163.172.189.201

  This will permanently delete all data.

? Continue? (y/N) y

🗑️  Destroying environment

  ✓ Port forwarding stopped
  ✓ SSH connections closed
  ✓ Instance terminated
  ✓ Resources cleaned up

✅ Environment destroyed in 00:00:15
   Zero resources running. Zero cost.

Use --yes or -y to skip confirmation:

dock destroy --yes

Prerequisites

  • Terraform CLI
  • Scaleway CLI (scw)
  • Scaleway API credentials
  • SSH key pair (~/.ssh/id_ed25519 or ~/.ssh/id_rsa)

CI Secrets

Pipeline and nightly workflows use the following repository secrets:

Secret Required for Description
SCW_ACCESS_KEY Tests + Nightly e2e jobs Scaleway access key
SCW_SECRET_KEY Tests + Nightly e2e jobs Scaleway secret key
SCW_PROJECT_ID Tests + Nightly e2e jobs Scaleway project ID
DISCORD_INSIGHTS_WEBHOOK Tests workflow notifications Discord webhook for #pipeline-insights
DISCORD_ISSUES_WEBHOOK Tests + Nightly notifications Discord webhook for #issues alerts
SLACK_WEBHOOK Nightly notifications Slack webhook for #dock-security nightly report

Core Commands

Lifecycle

dock create              # Create new environment
dock start               # Power on stopped environment
dock stop                # Power off (preserves data)
dock reboot              # Reboot running environment
dock destroy             # Delete everything (zero cost)
dock status              # Show current state

Working

dock ssh                 # Open SSH shell
dock ssh "docker ps"     # Run remote command

Port Forwarding

dock portforward         # Forward ports (foreground)
dock portforward -d      # Forward ports (background)
dock portforward --stop  # Stop background tunnel

Auto-Pilot Mode

By default, dock runs in auto-pilot mode, which automatically handles connection setup after dock create and dock start.

What auto-pilot does

After dock create or dock start completes:

Action Equivalent Manual Command
SSH multiplexing setup dock ssh-config --start-master
Port forwarding (background) dock portforward -d
Docker environment export DOCKER_HOST=ssh://root@<ip>
Kubernetes config export KUBECONFIG=~/.kube/dock-config

Commands handled by auto-pilot

Command Auto-pilot actions
dock create Full setup (SSH + ports + Docker + K8s)
dock start Reconnect all services
dock stop Clean up connections
dock destroy Clean up connections

Shell integration

Run dock init once to add auto-pilot integration to your shell. This sources ~/.dock/dock.init which automatically sets environment variables when dock is running.

Disable auto-pilot

dock env --set AUTO_PILOT=false

When disabled, you manage connections manually:

dock create
dock ssh-config --start-master
dock portforward -d
eval $(dock docker-env)
export KUBECONFIG=~/.kube/dock-config

Snapshots & Branching

Checkpoint your environment and branch into isolated lineages — like git, but for your whole machine.

Checkpoint the running instance

dock snap                          # Save current state to active branch
dock snap --branch feature-x       # Fork into a new branch

Fast startup from a snapshot

dock create --snapshot             # Pick and restore a snapshot interactively

Inspect the branch tree

dock snap --tree                   # Show full branch + snapshot tree
dock snap --tree root/main         # Scope to a branch and its descendants

List snapshots

dock snap --list                   # All branches with snapshot history
dock snap --list root/main         # Scoped to a branch
dock snap --current                # Print active branch path

Snapshots preserve:

  • Installed packages and tools
  • Docker images and containers
  • Configuration files
  • Everything on the disk

Environment Configuration

View current configuration

dock env

Set configuration

dock env --set SCW_INSTANCE_TYPE=DEV1-L,SCW_ZONE=fr-par-2

Remove configuration

dock env --unset SCW_INSTANCE_NAME

Available options

Variable Default Description
SCW_ACCESS_KEY (required) Scaleway access key
SCW_SECRET_KEY (required) Scaleway secret key
SCW_PROJECT_ID (required) Scaleway project ID
SCW_REGION fr-par Scaleway region
SCW_ZONE fr-par-1 Scaleway zone
SCW_INSTANCE_TYPE DEV1-M Instance type (see below)
SCW_INSTANCE_IMAGE (auto) Instance image
SCW_INSTANCE_NAME dock-env Instance name
SSH_PUBLIC_KEY_PATH ~/.ssh/id_ed25519.pub SSH public key
SSH_PRIVATE_KEY_PATH ~/.ssh/id_ed25519 SSH private key
K8S_ENGINE k3s Kubernetes: k3s or kind
FORWARD_PORTS 8080,3000,5432,6379,27017 Ports to forward
AUTO_PILOT true Enable auto-pilot mode

CLI Behavior

Variable Default Description
DOCK_NONINTERACTIVE 0 Set to 1 to disable all prompts (for CI/scripts)
DOCK_VERBOSE 0 Set to 1 to enable verbose output
NO_COLOR 0 Set to 1 to disable colored output

Instance Types

Type vCPU RAM Best for
DEV1-S 2 2GB Light development
DEV1-M 3 4GB Standard development
DEV1-L 4 8GB Heavy workloads
DEV1-XL 4 12GB Large projects
L4-1-24G 8 48GB GPU/ML workloads

Advanced Usage

Docker

# Simple mode (SSH per command)
eval $(dock docker-env)
docker ps

# Tunnel mode (single connection, faster for heavy use)
dock docker-tunnel -d
export DOCKER_HOST=unix://~/.dock/sockets/docker.sock
docker ps

Kubernetes

dock kubeconfig
export KUBECONFIG=~/.kube/dock-config
kubectl get nodes

SSH Configuration

dock ssh-config             # Set up SSH multiplexing
dock ssh-config --start-master  # Start master connection
dock configure              # Apply SSH server settings
dock configure --show       # Show remote SSH config

Connection Management

dock connection             # Show connection status
dock connection --refresh   # Restart all connections
dock connection --clean     # Stop all connections

Analytics

dock analytics              # Show usage summary
dock analytics --last       # Show last 10 operations
dock analytics --all        # Show all operations

Shell Setup

dock init          # Set up shell integration (auto-pilot env vars)
dock autocomplete  # Set up tab completion

All Commands

Command Description
dock create Create and provision environment
dock create --snapshot Create from snapshot (fast)
dock destroy Destroy all resources
dock status Show current state
dock start Power on stopped environment
dock stop Gracefully shut down
dock reboot Reboot running environment
dock ssh [cmd] SSH into environment
dock kubeconfig Fetch/update kubeconfig
dock docker-env Print DOCKER_HOST export
dock docker-tunnel Forward Docker socket
dock portforward Forward ports
dock configure Apply SSH config to remote
dock connection Manage connections
dock snap Checkpoint environment; branch and inspect snapshot tree
dock env Manage environment variables
dock analytics View usage statistics
dock init Set up shell integration
dock autocomplete Set up tab completion
dock upgrade Upgrade to latest version or tracked stream (--track=<branch>)
dock version Show version

Use dock <command> --help for detailed help on any command.


Cost

State Cost
Running ~€7.99/month (DEV1-M)
Stopped ~€1.60/month (disk only)
Destroyed €0

Architecture

┌──────────────┐
│   dock CLI   │  ← Bun/TypeScript
└──────┬───────┘
       │
       ▼
┌──────────────────────────┐
│ Terraform + scw          │  ← IaC layer
└──────┬───────────────────┘
       │
       ▼
┌──────────────────────────┐
│ Scaleway Instance        │
│  - Ubuntu 22.04          │
│  - Docker                │
│  - k3s                   │
└──────────────────────────┘

Installation Options

One-liner (recommended)

curl -fsSL https://raw.githubusercontent.com/jiraguha/dock/main/install.sh | bash

Manual download

Download from Releases:

Platform Binary
Linux x64 dock-linux-x64
Linux ARM64 dock-linux-arm64
macOS x64 dock-darwin-x64
macOS ARM64 dock-darwin-arm64
chmod +x dock-*
sudo mv dock-* /usr/local/bin/dock

From source

git clone https://github.com/jiraguha/dock.git
cd dock
bun install
./bin/dock --help

Roadmap

  • Automatic Shutdown (Kill Switch) — Heartbeat mechanism to auto-shutdown inactive machines; destroy after 1 week of inactivity (3)
  • Single Executable CLI — Package CLI as a self-contained executable
  • Self-Upgrading CLI — Automatic updates to latest version
  • File Transfer (send/fetch) — Simple file upload/download commands for quick file transfers (2)
  • Bidirectional Directory Sync — Real-time sync between local and remote directories
  • Beautiful CLI UX — Enhanced CLI with spinners, colors, progress tracking, and consistent output (@clack/prompts + picocolors)
  • OpenClaw Safe Mode — Restrict actions to safe, reversible, or sandboxed operations
  • MCP Integration — Machine Control Protocol for advanced lifecycle management
  • Multi-Environment Support — Manage multiple isolated environments (dev, staging, prod)
  • Multi-Provider VM Support — AWS, GCP, Azure, and other providers (1:gcp)
  • Web UI — Web interface for managing environments and machines
  • NixOS Integration — Declarative, reproducible development environments with Nix
  • Claude Code Integration — AI-assisted development workflow with Claude Code

License

MIT

About

Dock — a disposable execution surface for remote dev that feels local — and it's all extremely easy!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors