skillfed

docker

A Python library for the Docker Engine API.

docker Permissive license Apache-2.0 Active 7,209 v7.2.0 released

Install

docker on PyPI

pip

pip install docker

uv

uv add docker

poetry

poetry add docker

Package 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

Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Utilities

About docker

from the package's own PyPI description — quoted content, verbatim

Docker SDK for Python

Build Status (image)

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:

&gt;&gt;&gt; client.containers.run("ubuntu:latest", "echo hello world")
'hello world\n'

You can run containers in the background:

&gt;&gt;&gt; client.containers.run("bfirsh/reticulate-splines", detach=True)
&lt;Container '45e6d2de7c54'&gt;

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.
docker api pythoncontainer management librarydocker engine python clientrun containers from pythondocker orchestration sdkcontainerization pythondocker swarm management

Similar packages