--- id: prefect-docker version: "0.7.3" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # prefect-docker — Prefect integrations for interacting with Docker. License: permissive · Maintenance: active · Downloads: 2.3M/mo ## What it is and what it does prefect-docker is an official integration that extends Prefect's workflow orchestration to execute tasks inside Docker containers. It bridges the Prefect task execution model with Docker's containerization, letting you define and run workflow steps as isolated container workloads rather than in-process Python functions. The package wraps Docker and python-on-whales to manage container lifecycle and communication. This is useful when you need task isolation, dependency management, or reproducible execution environments within a Prefect workflow. You define tasks normally in Prefect, then specify Docker container configuration to run them containerized. The integration handles container creation, execution, and cleanup as part of the Prefect task lifecycle. Use it for: - Run Prefect tasks in isolated Docker containers to avoid dependency conflicts between workflow steps. - Execute workflow tasks with specific OS or system library requirements inside a container image. - Ensure reproducible task execution across different environments by containerizing task logic. - Integrate legacy or third-party applications into Prefect workflows by wrapping them in Docker containers. - Distribute task execution across container orchestration platforms by using Docker as the execution backend. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Docker task execution and container management integrations for Prefect workflow orchestration, enabling you to run Prefect tasks inside Docker containers. Yes, if you use Prefect and need to run tasks in Docker containers. It's actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. The integration is part of the official Prefect ecosystem. Install it when containerized task execution is part of your workflow design; skip it if you run all tasks in-process. ## Install pip install prefect-docker uv add prefect-docker poetry add prefect-docker ## Installing prefect-docker Before you install: Low install friction with a pure-Python wheel. Active maintenance—last commit 2026-08-14, released 30 days ago. Supports Python 3.10 through 3.13. Depends on prefect, docker, exceptiongroup, and python-on-whales; all are standard ecosystem packages. License in practice: Licensed under Apache License 2.0 (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install prefect-docker from prefect_docker import DockerContainer from prefect import flow, task @task def my_task(): return "Hello from Docker" @flow def my_flow(): my_task.with_options(container=DockerContainer()).submit() Requires Docker daemon running locally or accessible via docker socket; requires Prefect to be installed and configured. Verify before relying: - Specific Docker API features or container orchestration patterns this integration supports beyond basic task execution. - Whether this package handles Docker networking, volume mounting, or environment variable injection for containerized tasks. - Performance characteristics or scaling limits when running many concurrent Docker-based tasks. ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags prefect docker integration, run tasks in docker containers, docker workflow orchestration, prefect container execution, docker task runner, containerized prefect workflows, workflow-orchestration, docker-integration, task-execution [View on SkillFed](https://skillfed.io/packages/prefect-docker) · [View on PyPI](https://pypi.org/project/prefect-docker/)