GithubHelp home page GithubHelp logo

isabella232 / em-docker-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hpcloud/em-docker-client

0.0 0.0 0.0 29 KB

An EM-based non-blocking client for docker (in development)

Ruby 99.11% Makefile 0.89%

em-docker-client's Introduction

em-docker-client

This gem provides an EventMachine-based fully non-blocking interface to the Docker API.

It currently only supports em-synchrony-like environments. This means that all of your code must be wrapped in a Fiber (if you use EM.synchrony instead of EM.new, this is done for you). Callbacks may be supported in the future.

Installation

Add this line to your Gemfile:

gem 'em-docker-client', :require => 'em/docker/client', :git => "https://github.com/ActiveState/em-docker-client.git"

Then run:

$ bundle install

Alternatively, if you wish to just use the gem in a script, you can run:

$ git clone https://github.com/ActiveState/em-docker-client.git
$ cd em-docker-client
$ gem build em-docker-client.gemspec
$ gem install em-docker-client

Then, add require 'em/docker/client' to the top of the file using this gem.

Usage

require 'em/docker/client'
require 'eventmachine'

EM.run do
  Fiber.new {
    client = EM::Docker::Client.new
    p client.info
    # => {:containers=>22,
    #  :images=>14,
    #  :debug=>true,
    #  :nfd=>9,
    #  :ngoroutines=>11,
    #  :memory_limit=>true,
    #  :swap_limit=>nil,
    #  :ipv4_forwarding=>true}

    p client.version
    # => {:version=>"0.6.1", :git_commit=>"5105263", :go_version=>"go1.1.2"}

    p client.containers
    # => [...]

    container = client.create_container( :image => 'ubuntu:12.04', :cmd => '/bin/echo' )
    p container.id
    # => "ae1e4a710e13"

    container.delete
  }.resume
end

em-docker-client's People

Contributors

aarondl avatar dkulchenko avatar jandubois avatar razzell 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.