docker
A Python library for the Docker Engine API.
Install
docker on PyPI
pip
pip install dockeruv
uv add dockerpoetry
poetry add dockerPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pywin32, requests, urllib3 |
| Maintenance | actively maintained — 35 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: docker-7.2.0-py3-none-any.whl
About docker
from the package's own PyPI description — quoted content, verbatim
Docker SDK for Python
A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run containers, manage containers, manage Swarms, etc.
Installation
The latest stable version is available on PyPI. Install with pip:
pip install docker
> Older versions (< 6.0) required installing docker[tls] for SSL/TLS support.
> This is no longer necessary and is a no-op, but is supported for backwards compatibility.
Usage
Connect to Docker using the default socket or the configuration in your environment:
import docker
client = docker.from_env()
You can run containers:
>>> client.containers.run("ubuntu:latest", "echo hello world")
'hello world\n'
You can run containers in the background:
>>> client.containers.run("bfirsh/reticulate-splines", detach=True)
<Container '45e6d2de7c54'>
You can manage containers:
```python >>> client.containers.list() [<Container...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
A Python library that lets you programmatically control Docker—running containers, managing images, and orchestrating Swarms—using the same operations available from the docker command-line tool.
Low friction: pure-Python wheel with only three runtime dependencies (pywin32, requests, urllib3). Actively maintained with a recent release 35 days ago and strong repository signals (7209 stars, last commit 2026-08-13).
Apache-2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Usage
pip install docker
import docker
client = docker.from_env()
client.containers.run("ubuntu:latest", "echo hello world")
Requires Docker Engine to be installed and running; docker.from_env() connects to the local Docker daemon via socket or environment configuration.
Verdict: Production-ready, actively maintained library with no known vulnerabilities, low install friction, and permissive licensing. Supports Python 3.8–3.12 and is widely used (top 1000 PyPI). Safe to adopt for Docker automation in Python applications.
Needs verification
- Whether pywin32 is a hard runtime requirement on all platforms or only Windows; the fact sheet does not clarify platform-specific dependency handling.
Similar packages
permissive · top 1,000 on PyPI
jirapermissive · top 1,000 on PyPI
multidictpermissive · top 100 on PyPI
azure-cosmospermissive · top 1,000 on PyPI
oscryptopermissive · top 1,000 on PyPI
caiopermissive · top 1,000 on PyPI
blispermissive · top 1,000 on PyPI
certificopyleft · top 100 on PyPI
socksiopermissive · top 1,000 on PyPI
cfgvpermissive · top 1,000 on PyPI