Docker Python SDK Maintenance: What’s the Story?
Python Docker SDK - Stack Overflow
Issue with Python Docker SDK
Python Docker SDK error: invalid proto, expected tcp
Videos
» pip install docker-py
I’ve been using the Docker Python SDK for a while, and it’s a fantastic tool - but I’ve noticed the GitHub repo has ~500 open issues (some from 5+ years ago) and ~90 unreviewed PRs, including small but impactful fixes.
I understand maintainers are volunteers, often busy, but it’s unusual to see such a critical project with so little activity. Does anyone know if there’s a reason for the slow review process? Is the team understaffed, or is there a shift in focus away from this SDK?
I’ve submitted a few changes myself, that would be helpful for my work, but they’ve been waiting for months. Just curious if there’s a way to help move things forward—maybe more contributors are needed?
Thanks for any insights!
I can not get the Python Docker SDK to create a client. I am on the latest version of Docker, and Python 3.11.
I have already tried restarting the docker service and socket (on Arch using systemctl).
```python
import docker
client = docker.from_env()
```
`DockerException: Error while fetching server API version: Not supported URL scheme http+docker`
I created a package to make this easy: python-on-whales
Install with
pip install python-on-whales
Then you can do
from python_on_whales import docker
docker.compose.up()
docker.compose.stop()
# and all the other commands.
You can find the source for the package in my GitHub repository: https://gabrieldemarmiesse.github.io/python-on-whales/
I am working on the same issue and was looking for answers, but nothing so far. The best shot I can give it is to simplify that docker-compose logic. For example, you have a YAML file with a network and services - create them separately using Python Docker SDK and connect containers to a network.
It gets cumbersome, but eventually you can get things working that way from Python.
The base_url parameter is the URL of the Docker server, not the Docker Registry.
Try something like:
from docker.errors import APIError, TLSParameterError
try:
client = docker.from_env()
client.login(username=args.docker_user, password=args.docker_password, registry=args.docker_registry)
except (APIError, TLSParameterError) as err:
# ...
Here's how I have logged in to Docker using Python:
import docker
client = docker.from_env()
client.login(username='USERNAME', password='PASSWORD', email='EMAIL',
registry='https://index.docker.io/v1/')
and here's what it returns:
{'IdentityToken': '', 'Status': 'Login Succeeded'}
So, that means it has been logged in successfully.
» pip install docker-sdk