hack.foo
Guides

Daytona

Not run yet. This page follows the provider's documentation as read on 2026-11-18 (snapshots, process execution, secrets, preview). The install step is the one in Any Linux machine with Docker.

Daytona sandboxes are driven through its API, SDK or CLI. They have no repository hook. Docker-in-Docker is documented with a Docker-capable snapshot of at least 2 vCPU and 4 GiB.

Set up

  • Snapshot from a Dockerfile: Ubuntu with Docker installed (Daytona's docs use curl -fsSL https://get.docker.com | VERSION=28.3.3 sh -), the Compose plugin, tmux if the project has lifecycle processes, and hack from the release installer, in the Dockerfile: RUN curl -fsSL https://github.com/hack-dance/hack/releases/latest/download/hack-install.sh | HACK_INSTALL_NONINTERACTIVE=1 HACK_INSTALL_BIN=/usr/local/bin bash. No Docker engine runs during the build, so the installer's own hack global install step cannot start the proxy. Build it with the CLI: daytona-v0 snapshot create <name> --dockerfile ./Dockerfile (the dashboard builds image-based snapshots only).
  • Create the sandbox with HACK_ENV_SECRET_KEY in envVars. Daytona Secrets give the process a placeholder and cannot decrypt Hack's values.
  • Clone the project into the sandbox once (Daytona's Git operations, or git clone in a command), for example to ~/project.
  • After each start, run in the project directory. With the SDK, pass the directory and a longer timeout: process.executeCommand stops a command after 10 seconds by default (TypeScript: executeCommand(command, cwd, env, timeout); Python: process.exec(command, cwd=..., timeout=...)):
(dockerd >/var/log/dockerd.log 2>&1 &)
for i in $(seq 1 30); do docker info >/dev/null 2>&1 && break; sleep 1; done
hack config set --global proxy.bind_address 127.0.0.1
hack global install --no-interactive
hack up --detach --no-interactive --json

Give it at least 300 seconds: the first run pulls images.

Check it

curl --noproxy hello.hack.local --resolve hello.hack.local:443:127.0.0.1 -k https://hello.hack.local/

Expected differences

  • Preview URLs (https://<port>-<sandbox>.<domain>) carry their own host name, which Hack's proxy has no route for yet.
  • Stopping a sandbox keeps its files but not running processes. Run the start commands again.

Source: v5 (next.34) · docs/site/guides/cloud-daytona.md.

On this page