Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin to api v0.11 #153

Merged
merged 6 commits into from
Jun 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ docker-api
==========
[![Gem Version](https://badge.fury.io/rb/docker-api.png)](http://badge.fury.io/rb/docker-api) [![travis-ci](https://travis-ci.org/swipely/docker-api.png?branch=master)](https://travis-ci.org/swipely/docker-api) [![Code Climate](https://codeclimate.com/github/swipely/docker-api.png)](https://codeclimate.com/github/swipely/docker-api) [![Dependency Status](https://gemnasium.com/swipely/docker-api.png)](https://gemnasium.com/swipely/docker-api)

This gem provides an object-oriented interface to the [Docker Remote API](http://docs.docker.io/en/latest/reference/api/docker_remote_api/). Every method listed there is implemented, with the exception of attaching to the STDIN of a Container. At the time of this writing, docker-api is meant to interface with Docker version 0.9.*.
This gem provides an object-oriented interface to the [Docker Remote API](http://docs.docker.io/en/latest/reference/api/docker_remote_api/). Every method listed there is implemented. At the time of this writing, docker-api is meant to interface with Docker version 0.11.*.

If you're interested in using Docker to package your apps, we recommend the [dockly](https://github.com/swipely/dockly) gem. Dockly provides a simple DSL for describing Docker containers that install as Debian packages and are controlled by upstart scripts.

Expand Down
20 changes: 10 additions & 10 deletions lib/docker/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@ def import(imp, opts = {}, conn = Docker.connection)
raise Docker::Error::IOError, "Could not import '#{imp}'"
end

def import_stream(options = {}, connection = Docker.connection, &block)
body = connection.post(
'/images/create',
options.merge('fromSrc' => '-'),
:headers => { 'Content-Type' => 'application/tar',
'Transfer-Encoding' => 'chunked' },
&block
)
new(connection, 'id'=> Docker::Util.parse_json(body)['status'])
end
def import_stream(options = {}, connection = Docker.connection, &block)
body = connection.post(
'/images/create',
options.merge('fromSrc' => '-'),
:headers => { 'Content-Type' => 'application/tar',
'Transfer-Encoding' => 'chunked' },
&block
)
new(connection, 'id'=> Docker::Util.parse_json(body)['status'])
end

# Given a Dockerfile as a string, builds an Image.
def build(commands, opts = {}, connection = Docker.connection, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/docker/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module Docker
VERSION = '1.11.1'

# The version of the compatible Docker remote API.
API_VERSION = '1.10'
API_VERSION = '1.11'
end
8 changes: 0 additions & 8 deletions spec/docker/container_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@

it 'returns the changes as an array', :vcr do
expect(changes).to eq [
{
"Path" => "/dev",
"Kind" => 0
},
{
"Path" => "/dev/kmsg",
"Kind" => 0
},
{
"Path" => "/root",
"Kind" => 2
Expand Down
6 changes: 3 additions & 3 deletions spec/docker/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@
let(:image) { subject.create('fromImage' => 'ubuntu') }
let(:creds) {
{
:username => 'nahiluhmot',
:password => '*********',
:email => 'hulihan.tom159@gmail.com'
:username => 'tlunter',
:password => '************',
:email => 'tlunter@gmail.com'
}
}

Expand Down
10 changes: 6 additions & 4 deletions spec/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
subject.url = nil
subject.options = nil
end
let(:expected) { %w[Arch GitCommit GoVersion KernelVersion Os Version] }
let(:expected) {
%w[ApiVersion Arch GitCommit GoVersion KernelVersion Os Version]
}

let(:version) { subject.version }
it 'returns the version as a Hash', :vcr do
Expand Down Expand Up @@ -137,9 +139,9 @@
# cassette to match these credentials
let(:credentials) {
{
:username => 'test',
:password => 'account',
:email => 'test@test.com',
:username => 'tlunter',
:password => '************',
:email => 'tlunter@gmail.com',
:serveraddress => 'https://index.docker.io/v1/'
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions spec/vcr/Docker/_info/returns_the_info_as_a_Hash.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
http_interactions:
- request:
method: get
uri: unix:///var/run/docker.sock/v1.10/info
uri: unix:///var/run/docker.sock/v1.11/info
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Swipely/Docker-API 1.9.1
- Swipely/Docker-API 1.11.1
Content-Type:
- text/plain
response:
Expand All @@ -21,15 +21,15 @@ http_interactions:
Job-Name:
- info
Date:
- Wed, 12 Mar 2014 13:32:21 GMT
- Thu, 26 Jun 2014 19:18:54 GMT
Content-Length:
- '693'
- '697'
Connection:
- close
body:
encoding: UTF-8
string: |
{"Containers":39,"Debug":0,"Driver":"devicemapper","DriverStatus":[["Pool Name","docker-8:4-12104-pool"],["Data file","/var/lib/docker/devicemapper/devicemapper/data"],["Metadata file","/var/lib/docker/devicemapper/devicemapper/metadata"],["Data Space Used","1631.8 Mb"],["Data Space Total","102400.0 Mb"],["Metadata Space Used","4.1 Mb"],["Metadata Space Total","2048.0 Mb"]],"ExecutionDriver":"native-0.1","IPv4Forwarding":1,"Images":25,"IndexServerAddress":"https://index.docker.io/v1/","InitPath":"/usr/lib/docker/dockerinit","InitSha1":"df6aa6b00e1e829a422f1a761d0fab5425291e07","KernelVersion":"3.13.6-1-ARCH","MemoryLimit":1,"NEventsListener":0,"NFd":19,"NGoroutines":19,"SwapLimit":0}
{"Containers":31,"Debug":0,"Driver":"devicemapper","DriverStatus":[["Pool Name","docker-8:2-5393690-pool"],["Data file","/var/lib/docker/devicemapper/devicemapper/data"],["Metadata file","/var/lib/docker/devicemapper/devicemapper/metadata"],["Data Space Used","9805.8 Mb"],["Data Space Total","102400.0 Mb"],["Metadata Space Used","16.1 Mb"],["Metadata Space Total","2048.0 Mb"]],"ExecutionDriver":"native-0.2","IPv4Forwarding":1,"Images":204,"IndexServerAddress":"https://index.docker.io/v1/","InitPath":"/usr/lib/docker/dockerinit","InitSha1":"728ea391473ec106b15a6486b3b1a2e8a07e4ff5","KernelVersion":"3.15.1-1-ARCH","MemoryLimit":1,"NEventsListener":0,"NFd":20,"NGoroutines":27,"SwapLimit":0}
http_version:
recorded_at: Wed, 12 Mar 2014 13:32:21 GMT
recorded_with: VCR 2.8.0
recorded_at: Thu, 26 Jun 2014 19:18:54 GMT
recorded_with: VCR 2.9.2
14 changes: 7 additions & 7 deletions spec/vcr/Docker/_version/returns_the_version_as_a_Hash.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading