Skip to main content

Docker-Fabric

Build Docker images, and run Docker containers in Fabric.

Project: https://github.com/merll/docker-fabric

Docs: https://docker-fabric.readthedocs.io/en/latest/

Overview

With a few preparations, Docker images can easily be generated and tested on development machines, and transferred on to a production environment. This package supports managing container configurations along with their dependencies within Fabric-based deployments. DockerFiles can also be easily implemented in Fabric tasks.

Local Docker clients can be controlled directly through docker-py. Remote Docker API services make use of Fabric’s SSH connection.

API access

This project is based on Docker-Map, and adapts its container configuration methods.

As with Docker-Map, container configurations can be generated as objects, updated from Python dictionaries, or imported from YAML files in order to control remote clients via the API. Docker-Fabric includes the following enhancements:

Docker client

DockerFabricClient adds Fabric-like logging in the context of container instances on top of Fabric hosts, and enables automatic creation of tunnel connections for access to a remote Docker host using Fabric’s SSH connection. By using the tool socat, the Docker client can access a remote service without re-configuration.

Client configuration

DockerClientConfiguration adds the capability of running containers to Fabric hosts with specific Docker settings for each, e.g. the version number.

Running container configurations

ContainerFabric is a simple wrapper that combines Docker-Map’s DockerFabricClient, DockerClientConfiguration objects, and container maps.

Command-line based access

The following features are provided by running the appropriate commands on a remote Docker command line:

  • Copy resources from a container to a Fabric host.

  • Copy resources from a container and download them in a compressed tarball. The Docker Remote API currently does not support creating compressed tarballs.

  • Copy resources from a container and store them in a new blank image.

  • Generate a compressed image tarball. The Docker Remote API currently does not support creating compressed tarballs, but is capable of importing them.

Tasks

All essential container actions (create, start, stop, remove) and some advanced (e.g. update) can be triggered from the command line as Fabric tasks and executed on the remote service, e.g. via SSH.

Additionally the following tasks are included in this package, that can be run by Fabric directly:

  • check_version: Returns version information of the remote Docker service and provides useful insight if permissions are set up properly.

  • cleanup_containers: Removes all containers that have stopped.

  • cleanup_images: Removes all untagged images, that do not have a dependent container or other dependent images.

  • remove_all_containers: Stops and removes all containers on the remote Docker service.

Contributions

Thanks to lfasnacht for publishing an implementation for a local tunnel to a Fabric client in the pull request 939 of Fabric.

Further contributions are maintained in CONTRIBUTIONS.md of the project.

Metadata

Release files for docker-fabric 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker-fabric 0.5.0
File Size Uploaded Provenance Actions
docker-fabric-0.5.0.tar.gz 24.0 kB Without provenance Details for docker-fabric-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docker-fabric 0.5.0
File Interpreter ABI Platform Actions
docker_fabric-0.5.0-py2.7.egg Legacy Egg format - - Details for docker_fabric-0.5.0-py2.7.egg

Total release size: 91.2 kB

Release files / docker-fabric-0.5.0.tar.gz

Download URL docker-fabric-0.5.0.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
08c092f72e363837d769a1590e1cae2a6fb396b489f06a5b5d82cdb711bb42b0
BLAKE2b-256 checksum
How to use checksums
1d662c75e141373dca58ec20ccdbb2b2204a07e02f692c7fc42c83fe98e71bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / docker_fabric-0.5.0-py2.7.egg

Download URL docker_fabric-0.5.0-py2.7.egg
Size 67.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
bd5660d79b205d828573fe9e373936ac998b1170efcbb861298df4f268264676
BLAKE2b-256 checksum
How to use checksums
49f7f63e9e24ee94e22eb6a51a0d03e0a9a46e130b6c948541b7b81831a15c5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for docker-fabric 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page