docker / docker/docker-py

Missing build and installation steps without using pip

Open
#3,265 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

I could not find the steps/documentation to build and install the docker sdk for python without using pip. I felt this requirement on Ubuntu 24.04 where a simple script just having two lines doesn't wrok.
client.py:

start of client.py

import docker;
client = docker.from_env()

end of client.py

Issue is described here and fixed in version 6.1.0 with PR 3116.

Ubuntu 24.04 have following versions of python3-requests, python3-urllib3 and python3-docker packages:

$ apt list --installed | grep python3-urllib3
python3-urllib3/noble,now 2.0.7-1 all [installed,automatic]

$ apt list --installed | grep python3-requests
python3-requests/noble,now 2.31.0+dfsg-1ubuntu1 all [installed,automatic]

intel@gramine2404:~/docker-7.0.0$  apt list --installed | grep python3-docker
python3-docker/noble,now 5.0.3-1ubuntu1 all [installed]

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

Installing docker using pip is not the option on Ubuntu 24.04:

$ pip3 install docker
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Hence I am left with no option except manually building and installing the package. I am looking for the steps to build and install it manually.

Also I would like to know the way to request Ubuntu 24.04 community to upgrade python3-docker=5.0.3 to python3-docker>=6.1.0 where the compatibility issue with requests and urllib3 is fixed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing installation and build documentation, then use client.py and the linked issue 3113, release 6.1.0, and PR 3116 as context. Document a supported non-pip installation path for Ubuntu 24.04 and point readers toward the appropriate Ubuntu packaging request for updating python3-docker.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.