skillfed

docker-py

Python client for Docker.

docker-py v1.10.6 1.1M downloads/30d#4,405 on PyPI7,209
Permissive license UNKNOWN Active released

What it is and what it does

docker-py is a Python wrapper around the Docker Remote API that lets you manage containers, images, and other Docker resources from Python code instead of shell commands. It exposes the same operations available in the docker CLI—starting and stopping containers, pulling and pushing images, inspecting logs, managing networks—but as Python method calls. The library has no runtime dependencies, making it lightweight to install.

The package is actively maintained and widely used (top 5000 on PyPI with over 1 million monthly downloads), though the latest release on PyPI dates to 2016. It carries no known security vulnerabilities and is licensed permissively under Apache 2.0, making it safe for commercial use.

Use it for:

  • Automate container orchestration and lifecycle management (start, stop, restart) from Python applications.
  • Build deployment tools or CI/CD pipelines that programmatically manage Docker containers and images.
  • Monitor and inspect running containers, logs, and resource usage from Python monitoring scripts.
  • Pull and push Docker images to registries as part of automated build or release workflows.
  • Test Python applications by spinning up and tearing down containerized services in test suites.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library that lets you control Docker containers, images, and services programmatically through the Docker Remote API instead of using the command line.

Yes, if you need to control Docker from Python and your environment supports the Docker daemon. The library is lightweight, permissively licensed, and actively maintained. However, verify that this is still the recommended Docker client for your Python version—the latest PyPI release is from 2016, and the modern Docker Python client may have a different package name or location.

Install

docker-py on PyPI

pip

pip install docker-py

uv

uv add docker-py

poetry

poetry add docker-py

Installing docker-py

Before you install

Low install friction with no runtime dependencies. The package is actively maintained with recent commits, though the latest PyPI release dates to 2016-11-02; the repository itself shows ongoing activity as of 2026-08-13.

License in practice

Licensed under Apache License, Version 2.0 (permissive), which allows commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install docker-py

import docker
client = docker.Client()
containers = client.containers()

Requires a running Docker daemon accessible to the Python process; connection details may need configuration depending on your Docker setup.

Verify before relying

  • Whether this package is still the recommended Docker client for Python (the modern package may be named differently).
  • Current Python version support—classifiers list Python 2.6–3.5, but requires_python is unspecified and the latest release is from 2016.

Package facts

License UNKNOWN (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 3,572 days since the last release
Last repo commit
First released
Downloads 1,074,698/month — #4,405 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: docker_py-1.10.6-py2.py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: Utilities

Tags

docker python clientprogrammatic docker controldocker container management pythondocker remote api pythonautomate docker with pythondocker image pull push pythonrun containers from python
dockercontainer-orchestrationdevops

More Utilities packages