π³ Docker Integration
What you'll learn
How to run pipelines in isolated Docker containers β eliminate "it works on my machine" bugs forever.
Containerize your pipelines for reproducible execution anywhere β from a laptop to a Kubernetes cluster.
Why Docker?
| Feature | Benefit |
|---|---|
| Isolation | Each step runs in a clean environment |
| Reproducibility | Identical code and dependencies in dev, staging, prod |
| Portability | Move from local Docker to K8s or cloud without code changes |
| Dependency Control | No conflicts between different step requirements |
π³ Running on Docker
FlowyML can automatically build and run your steps in Docker containers:
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
image |
str |
python:3.11-slim |
Base Docker image |
install_deps |
bool |
True |
Auto-install requirements.txt |
dockerfile |
str |
None |
Path to custom Dockerfile |
build_context |
str |
"." |
Docker build context |
volumes |
dict |
{} |
Volume mounts (host:container) |
env_vars |
dict |
{} |
Environment variables |
π Custom Dockerfiles
For complex dependencies, provide your own Dockerfile:
Example Dockerfile
π Volume Mounts
Mount local directories into the container for data access:
Best Practices
Pin image versions
Use python:3.11.7-slim instead of python:3.11-slim for reproducible builds.
Multi-stage builds
Use multi-stage Dockerfiles to keep images small β build dependencies in one stage, copy only artifacts to the final stage.
GPU support
For GPU steps, use NVIDIA base images (e.g., nvidia/cuda:12.0-runtime) and install nvidia-docker2.