Dockerc
Note: this is alpha software. The interfaces are not stable.
A lightweight docker client that focuses on:
- returning simple data structures instead of any defined object model
- normalization of parameters
- exceptions thrown in exceptional cases
- explicit code to reduce confusion
Installation
Add this line to your application's Gemfile:
gem 'dockerc'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dockerc
Usage
# connect to unix:///var/run/docker.sock
c = Dockerc::Client.new
# connect to an alternate docker endpoint
c = Dockerc::Client.new(docker_url: 'http://localhost:4243')
# pull an image from the public repository
c.pull_image 'gorsuch/litterbox'
# launch a container
c.create_container :image => 'gorsuch/litterbox', :cmd => 'date'
# list all containers
c.containers
#=> [{:command=>"date ", :created=>1392044336, :id=>"ea1c87570244276041caafb69ab2fd102c974b0b214e885304de00222b9f6bd0", :image=>"gorsuch/litterbox:latest", :names=>["/desperate_hawking"], :ports=>[], :status=>"Exit 0"}]
Contributing
- Fork it ( http://github.com/
/dockerc/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request