Docker BuildKit on Morph Cloud
tl;dr Launch optimized Docker environments with BuildKit enabled on Morph Cloud. Use Devboxes for developer-friendly prototyping and shareable previews, or use instances/snapshots for VM primitives.

Prerequisites
Install the Morph Cloud SDK
To get started, install the Morph Python SDK:
uv pip install morphcloud
Set your API key
export MORPH_API_KEY='your-key-here'
You can generate an API key in the Morph Cloud console.
Quick Start
Launch optimized Docker environments with BuildKit enabled for faster, more efficient container builds. Perfect for CI/CD pipelines and development workflows.
If you’re iterating on an app/service and want a quick shareable URL, start with Devboxes and treat BuildKit as tooling inside your devbox.
📁 Complete Docker BuildKit Example
The example includes:
- Docker installation with BuildKit configuration
- Multi-stage Dockerfile with parallel builds
- Health check and web server setup
- Service exposure and URL management
- Snapshot creation for reusable environments
Getting Started
# Install dependencies
uv pip install morphcloud
# Set your API key
export MORPH_API_KEY='your-key-here'
# Clone and run the complete example
git clone https://github.com/morph-labs/morphcloud-examples-public.git
cd morphcloud-examples-public/docker-buildkit
python docker-buildkit_setup.py
Once setup is complete, you can launch new instances instantly from the created snapshot for parallel build testing and isolated Docker environments.