In the last few recipes, we explored the APIs provided by Docker to connect and perform operations to the remote Docker daemon. The Docker community has added bindings for different programming languages to access those APIs. Some of them are listed at https://docs.docker.com/reference/api/remote_api_client_libraries/.
Note that Docker Maintainers do not maintain these libraries. Let's explore Python bindings with a few examples and see how it uses the Docker remote API.
Install
docker-py
on Fedora:$ sudo yum install python-docker-py
Alternatively, use
pip
to install the package:$ sudo pip install docker-py
Import the module:
$ python >>> import docker