prefect-docker
Prefect integrations for interacting with Docker.
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 on this page — 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
prefect-docker on PyPI
pip
pip install prefect-dockeruv
uv add prefect-dockerpoetry
poetry add prefect-dockerInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — prefect, docker, exceptiongroup, python-on-whales |
| Maintenance | actively maintained — 30 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,275,795/month — #3,172 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: prefect_docker-0.7.3-py3-none-any.whl
Keywords: prefect
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
prefect-azurePrefect integrations for orchestrating…
permissive · top 15,000 on PyPI
prefect-shellProvides Prefect workflow tasks for executing…
permissive · top 15,000 on PyPI
prefect-rayIntegrates Ray distributed computing with…
permissive · top 15,000 on PyPI
prefect-gcpIntegrates Prefect workflow orchestration with…
permissive · top 5,000 on PyPI
prefect-dbtPrefect integration that orchestrates dbt…
permissive · top 15,000 on PyPI
prefect-daskIntegrates Prefect workflow orchestration with…
permissive · top 15,000 on PyPI
prefect-redisIntegrates Prefect workflow orchestration with…
permissive · top 15,000 on PyPI
prefect-gitlabIntegrates Prefect workflow orchestration with…
permissive · top 15,000 on PyPI
prefect-clientA lightweight client library for interacting…
permissive · top 15,000 on PyPI
prefect-cloudDeploys Python functions to Prefect Cloud and…
unclear · top 5,000 on PyPI