tox-docker
Manage lifecycle of docker containers during Tox test runs
Decision gist · record as of 2026-08-14
Yes. If you use tox for testing and need Docker containers as part of your test environment, this plugin eliminates manual container orchestration. It's actively maintained, has no known vulnerabilities, carries a permissive license, and low install friction. Install it when your test suite depends on external services (databases, caches, APIs) that you want to manage declaratively.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Docker daemon to be running and accessible; tox must be installed in the same Python environment.
- Low install friction with a pure-Python wheel.
- Actively maintained as of 2026-08-10 with a stable release history since 2017.
License · maintenance · safety
permissive license (permissive) — Licensed under a permissive BSD license, suitable for use in both open-source and commercial projects without significant restrictions.
last release 2024-05-25 (811 days) · last repo commit 2026-08-10 · 181 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 102,767 downloads/mo, #12,849 on PyPI
Alternatives
Verify before relying
pip install tox-docker
# In tox.ini:
[testenv]
docker = db
commands = pytest tests
[docker:db]
image = postgres:11-alpine
environment = POSTGRES_PASSWORD=test- Whether container health checks block test execution reliably across different Docker configurations.
- Performance impact of parallel tox runs with multiple container instances on resource-constrained CI systems.
What it is and what it does
tox-docker is a plugin for tox that automates the lifecycle of Docker containers during test execution. Instead of manually starting services before running tests, you declare containers in your tox.ini configuration—specifying images, environment variables, port mappings, volumes, and health checks—and the plugin handles spinning them up before tests run and tearing them down afterward.
It integrates seamlessly into tox's existing workflow: you configure containers with a [docker:container-name] section, reference them in your [testenv] via a docker directive, and the plugin exposes container ports and hostnames as environment variables for your tests to use. It supports multi-stage Dockerfiles, container linking, health checks, and parallel test runs with automatic container name suffixing to avoid port conflicts.
Use it for
- Integration tests requiring a live PostgreSQL or MySQL database without manual container management.
- Testing microservices that depend on multiple containers (app server, cache, message queue) in a single tox run.
- CI/CD pipelines where you want reproducible test environments without external service setup scripts.
- Local development workflows where tox handles spinning up all test dependencies automatically.
- Verifying application behavior against specific database versions by swapping container images in tox.ini.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
If you use tox for testing and need Docker containers as part of your test environment, this plugin eliminates manual container orchestration. It's actively maintained, has no known vulnerabilities, carries a permissive license, and low install friction. Install it when your test suite depends on external services (databases, caches, APIs) that you want to manage declaratively.
Install
tox-docker on PyPI
Before you install
Low install friction with a pure-Python wheel. Actively maintained as of 2026-08-10 with a stable release history since 2017. Requires tox and docker as runtime dependencies, both of which are standard in testing workflows.
Requires Docker daemon to be running and accessible; tox must be installed in the same Python environment.
License in practice
Licensed under a permissive BSD license, suitable for use in both open-source and commercial projects without significant restrictions.
Quickstart
pip install tox-docker
# In tox.ini:
[testenv]
docker = db
commands = pytest tests
[docker:db]
image = postgres:11-alpine
environment = POSTGRES_PASSWORD=test
Verify before relying
- Whether container health checks block test execution reliably across different Docker configurations.
- Performance impact of parallel tox runs with multiple container instances on resource-constrained CI systems.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdockertox |
| Maintenance | Actively maintained 811 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,767 / month, #12,849 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: PluginsIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing |
Evidence: tox_docker-5.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tox docker containers”
- tox-dockerA tox plugin that manages Docker container lifecycle during test…
- tox-uv-baretox-uv-bare is a tox plugin that replaces virtualenv and pip with uv…
- tox-uvtox-uv replaces virtualenv and pip with uv in tox environments,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also onyx-devtools · pytest-container · docker-compose · dockerfile · tox-uv · dumb-init · tox-gh-actions · pytest-docker · tox-uv-bare · testcontainers-core