A Docker-based wrapper for running @charmland/crush in an isolated Debian environment. This tool allows you to run crush commands on any directory by automatically mounting it into a containerized environment.
- 🐳 Docker-based isolation - Runs crush in a clean Debian container
- 📦 Pre-configured environment - Node.js 21 and @charmland/crush pre-installed
- 🔄 Automatic cleanup - Containers are automatically removed after execution
- 🎲 Unique container names - Each run gets a randomly named container (e.g.,
crush-machine-swift-dragon-12345) - 📁 Directory mounting - Mount any local directory into the container
- 💾 Persistent data - Automatically mounts
~/.local/share/crushfor crush's local data - 🌐 Global installation - Install once, use from anywhere
- Docker and Docker Compose installed and running
- Bash shell
- Write access to
/usr/local/binor~/.local/bin(for global installation)
Install the crusher command globally so you can use it from anywhere:
./install.shThis will:
- Copy
crusher.shto/usr/local/bin/crusher(or~/.local/bin/crusherif/usr/local/binis not writable) - Copy
crush-machine.ymlandcrush-machine.dockerfileto the same directory - Make the command executable
After installation, verify it works:
crusher --helpYou can also use the script directly without installation:
./crusher.sh [directory]Run crush on the current directory:
crusherRun crush on a specific directory:
crusher /path/to/directory- Container Creation: Creates a uniquely named Docker container using docker-compose
- Directory Mounting: Mounts your specified directory to
/workspacein the container - Data Persistence: Mounts
~/.local/share/crushto preserve crush's local state - Execution: Runs the
crushcommand inside the container - Cleanup: Automatically removes the container when the command completes
Each container gets a unique name combining:
- Base name:
crush-machine - Random adjective-noun pair (e.g.,
swift-dragon,cosmic-phoenix) - Process ID:
$$
Example: crush-machine-neon-tiger-12345
crush-machine/
├── crusher.sh # Main script that orchestrates the container
├── crush-machine.yml # Docker Compose configuration
├── crush-machine.dockerfile # Docker image definition
├── install.sh # Installation script
├── uninstall.sh # Uninstallation script
└── README.md # This file
The Docker image is based on Debian and includes:
- Basic utilities (curl, git, vim, wget)
- Node.js 21
- @charmland/crush (installed globally)
To remove the globally installed crusher command:
./uninstall.shThis removes:
- The
crushercommand crush-machine.ymlcrush-machine.dockerfile
Ensure Docker is running:
docker psIf you get permission errors, try installing to ~/.local/bin:
mkdir -p ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"
./install.shEach container gets a unique name, so conflicts are unlikely. If you see errors about existing containers, you can manually remove them:
docker ps -a | grep crush-machine
docker rm <container-id>To modify the Docker environment, edit crush-machine.dockerfile and rebuild:
docker compose -f crush-machine.yml buildThis project is provided as-is for use with @charmland/crush.
- @charmland/crush - The crush tool this wrapper runs