# Charms.Docker
[](https://travis-ci.org/juju-solutions/charms.docker) [](https://coveralls.io/github/juju-solutions/charms.docker?branch=master)
This is a library intended to ease development of docker deliverable charms, by exposing an API that is easy to grok at an initial glance.
This library was borne from a disgust of mine at seeing many subprocess.check_call lines littered throughout charms. While functionally similar to what this library exposes, it should read better than many disjointed os exec calls.
This library is also targeted at python 3.3+
## To use charms.docker
This is actually embedded in the [layer:docker](http://github.com/juju-solutions/layer-docker) runtime layer. Unless you intend on hacking this, porting it elsewhere, or otherwise distrust the layer - you wont need to manually install this.
### Examples
#### Launch a one-off container
from charms.docker import Docker d = Docker() pid = d.up(‘lazypower/idlerpg:latest’, dirs={“files/idlerpg”:”/files/idlerpg”}, ports=[“8000:8000”]) payload-register(‘docker’, ‘application’, pid)
#### Launch a configured container, or many containers
But you wouldn’t really want to use this terribly often, as its more sensible to encapsulate the “configured state” of the container via a docker-compose yaml. Which is rumored to be simple to template, and then be used like so assuming the rendered template resides in $CHARM_DIR/files/workspace/docker-compose.yml:
from charms.docker import Compose c = Compose(‘files/workspace’) c.up()
### Get support
This project is under heavy development pending a 0.1.0 release. Until such time no methods should be assumed to be concrete until we land on a 1.0.0 release chain. Any charms based on this will be at the mercy of the author to stay abreast of the charm libraries changes.
Issue Tracker: [http://github.com/juju-solutions/charms.docker/issues](http://github.com/juju-solutions/charms.docker/issues)
Juju Mailing List: [juju@lists.ubuntu.com](mailto:juju@lists.ubuntu.com)
Metadata
Release files for charms.docker 0.1.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| charms.docker-0.1.19.tar.gz | 7.8 kB | Without provenance | Details for charms.docker-0.1.19.tar.gz |
Release files / charms.docker-0.1.19.tar.gz
| Download URL | charms.docker-0.1.19.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
735160e795894e6a007f333a5b755003db1825f4c67b0aaab8f16269656564eb
|
|
BLAKE2b-256 checksum How to use checksums |
7323742ede75326a9ed75c176be9cfd8b1010a116789a18b50723768ba026785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/2.7
|
Security for charms.docker 0.1.19
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.