GithubHelp home page GithubHelp logo

isabella232 / charms.docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juju-solutions/charms.docker

0.0 0.0 0.0 71 KB

Charming with Docker library to ease interfacing with the DockerCLI and configuring the Docker Daemon

Home Page: http://pythonhosted.org/charms.docker/

Python 98.90% Makefile 1.10%

charms.docker's Introduction

Charms.Docker

Build Status Coverage Status

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 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.

charms.docker's People

Contributors

caiobegotti avatar johnsca avatar lazypower avatar mbruzek avatar simonklb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.