loongson/pypi/: docker-4.2.1 metadata and description

Homepage Simple index

A Python library for the Docker Engine API.

classifiers
  • Development Status :: 5 - Production/Stable
  • Environment :: Other Environment
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Programming Language :: Python :: 2
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.5
  • Programming Language :: Python :: 3.6
  • Programming Language :: Python :: 3.7
  • Topic :: Software Development
  • Topic :: Utilities
  • License :: OSI Approved :: Apache Software License
description_content_type text/markdown
license Apache License 2.0
maintainer Joffrey F
maintainer_email joffrey@docker.com
project_urls
  • Documentation, https://docker-py.readthedocs.io
  • Changelog, https://docker-py.readthedocs.io/en/stable/change-log.html
  • Source, https://github.com/docker/docker-py
  • Tracker, https://github.com/docker/docker-py/issues
provides_extras tls
requires_dist
  • six (>=1.4.0)
  • websocket-client (>=0.32.0)
  • requests (!=2.18.0,>=2.14.2)
  • ipaddress (>=1.0.16) ; python_version < "3.3"
  • backports.ssl-match-hostname (>=3.5) ; python_version < "3.5"
  • pypiwin32 (==219) ; sys_platform == "win32" and python_version < "3.6"
  • pypiwin32 (==223) ; sys_platform == "win32" and python_version >= "3.6"
  • paramiko (>=2.4.2) ; extra == 'ssh'
  • pyOpenSSL (>=17.5.0) ; extra == 'tls'
  • cryptography (>=1.3.4) ; extra == 'tls'
  • idna (>=2.0.0) ; extra == 'tls'
requires_python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
docker-4.2.1-py2.py3-none-any.whl
Size
141 KB
Type
Python Wheel
Python
2.7

Docker SDK for Python

Build Status

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. Either add docker to your requirements.txt file or install with pip:

pip install docker

If you are intending to connect to a docker host via TLS, add docker[tls] to your requirements instead, or install with pip:

pip install docker[tls]

Usage

Connect to Docker using the default socket or the configuration in your environment:

import docker
client = docker.from_env()

You can run containers:

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

You can run containers in the background:

>>> client.containers.run("bfirsh/reticulate-splines", detach=True)
<Container '45e6d2de7c54'>

You can manage containers:

>>> client.containers.list()
[<Container '45e6d2de7c54'>, <Container 'db18e4f20eaa'>, ...]

>>> container = client.containers.get('45e6d2de7c54')

>>> container.attrs['Config']['Image']
"bfirsh/reticulate-splines"

>>> container.logs()
"Reticulating spline 1...\n"

>>> container.stop()

You can stream logs:

>>> for line in container.logs(stream=True):
...   print line.strip()
Reticulating spline 2...
Reticulating spline 3...
...

You can manage images:

>>> client.images.pull('nginx')
<Image 'nginx'>

>>> client.images.list()
[<Image 'ubuntu'>, <Image 'nginx'>, ...]

Read the full documentation to see everything you can do.