docker

A Python library for the Docker Engine API

Latest version: 7.1.0 registry icon
Maintenance score
100
Safety score
100
Popularity score
100
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
7.1.0 0 0 0 0 0
7.0.0b3 0 0 0 0 0
7.0.0b2 0 0 0 0 0
7.0.0 0 0 0 0 0
6.1.3 0 0 0 0 0
6.1.2 0 0 0 0 0
6.1.1 0 0 0 0 0
6.1.0 0 0 0 0 0
6.0.1 0 0 0 0 0
6.0.0b2 0 0 0 0 0
6.0.0b1 0 0 0 0 0
6.0.0 0 0 0 0 0
5.0.3 0 0 0 0 0
5.0.2 0 0 0 0 0
5.0.1 0 0 0 0 0
5.0.0 0 0 0 0 0
4.4.4 0 0 0 0 0
4.4.3 0 0 0 0 0
4.4.2 0 0 0 0 0
4.4.1 0 0 0 0 0
4.4.0 0 0 0 0 0
4.3.1 0 0 0 0 0
4.3.0 0 0 0 0 0
4.2.2 0 0 0 0 0
4.2.1 0 0 0 0 0
4.2.0 0 0 0 0 0
4.1.0 0 0 0 0 0
4.0.2 0 0 0 0 0
4.0.1 0 0 0 0 0
4.0.0 0 0 0 0 0
3.7.3 0 0 0 0 0
3.7.2 0 0 0 0 0
3.7.1 0 0 0 0 0
3.7.0 0 0 0 0 0
3.6.0 0 0 0 0 0
3.5.1 0 0 0 0 0
3.5.0 0 0 0 0 0
3.4.1 0 0 0 0 0
3.4.0 0 0 0 0 0
3.3.0 0 0 0 0 0
3.2.1 0 0 0 0 0
3.2.0 0 0 0 0 0
3.1.4 0 0 0 0 0
3.1.3 0 0 0 0 0
3.1.2 0 0 0 0 0
3.1.1 0 0 0 0 0
3.1.0 0 0 0 0 0
3.0.1 0 0 0 0 0
3.0.0 0 0 0 0 0
2.7.0 0 0 0 0 0
2.6.1 0 0 0 0 0
2.6.0 0 0 0 0 0
2.5.1 0 0 0 0 0
2.5.0 0 0 0 0 0
2.4.2 0 0 0 0 0
2.4.1 0 0 0 0 0
2.4.0 0 0 0 0 0
2.3.0 0 0 0 0 0
2.2.1 0 0 0 0 0
2.2.0 0 0 0 0 0
2.1.0 0 0 0 0 0
2.0.2 0 0 0 0 0
2.0.1 0 0 0 0 0
2.0.0 0 0 0 0 0
0.0.1 0 0 1 0 0

Stability
Latest release:

7.1.0 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-1.0   -   Apache License 1.0

Not a wildcard

Not proprietary

OSI Compliant



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. Install with pip:

pip install docker

Older versions (< 6.0) required installing docker[tls] for SSL/TLS support. This is no longer necessary and is a no-op, but is supported for backwards compatibility.

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.