docker-api 1.10.2 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b46cdd5696d4b7d1adfc05957499b466bab318b2
4
- data.tar.gz: f8574306660d31b28bab6c080caeab37b10f18d7
3
+ metadata.gz: 8cb36a5993a313d48077ee68360b298a3a1d7fb3
4
+ data.tar.gz: 00bd95c6605e8cd51541c58364421e3b969464b4
5
5
  SHA512:
6
- metadata.gz: 39398561ff708d43c6780c75614bd30dbb96dcd2ba81cecb2e7b6dab45f38effec2620ffa72b0d7d487c31dfdad7018786911ad87f44bb673da7b711508305e5
7
- data.tar.gz: 7dc5a542a78b64264b6e76e29125792c7c2ff3d5b17fbcca65a6417c2fb55317ec2169b3dfc08c7b2634c162a2f1f7711e84fffa380875cd6b3c1e83201fe476
6
+ metadata.gz: 923f01064e6a3829bf019e00c2ae73dc99c0e9331d95f1e6058b9cce2f5e42339806017c89998dd3d1c61ddd462f40863a04b2c52f767691006adf8161ccad7b
7
+ data.tar.gz: 38cf6d35c30a98adcdf1afc992b60d8bd29d6ec10ddbae9a72eefe31e3dad386d556e87309730639467f6cbc01394505132399ed5107f471a4950c5f438eaecc
data/README.md CHANGED
@@ -2,7 +2,7 @@ docker-api
2
2
  ==========
3
3
  [![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)
4
4
 
5
- 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.8.*.
5
+ 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.*.
6
6
 
7
7
  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.
8
8
 
@@ -147,6 +147,16 @@ image.remove(:force => true)
147
147
  Docker::Image.import('some-export.tar')
148
148
  # => Docker::Image { :id => 66b712aef, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
149
149
 
150
+ # `Docker::Image.import` can also import from a URI
151
+ Docker::Image.import('http://some-site.net/my-image.tar')
152
+ # => Docker::Image { :id => 6b462b2d2, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
153
+
154
+ # For a lower-level interface for importing tars, `Docker::Image.import_stream` may be used.
155
+ # It accepts a block, and will call that block until it returns an empty `String`.
156
+ File.open('my-export.tar') do |file|
157
+ Docker::Image.import_stream { file.read(1000).to_s }
158
+ end
159
+
150
160
  # Create an Image from a Dockerfile as a String.
151
161
  Docker::Image.build("from base\nrun touch /test")
152
162
  # => Docker::Image { :id => b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
data/docker-api.gemspec CHANGED
@@ -23,4 +23,5 @@ Gem::Specification.new do |gem|
23
23
  gem.add_development_dependency 'pry'
24
24
  gem.add_development_dependency 'vcr', '>= 2.7.0'
25
25
  gem.add_development_dependency 'simplecov'
26
+ gem.add_development_dependency 'webmock'
26
27
  end
data/lib/docker.rb CHANGED
@@ -6,6 +6,7 @@ require 'base64'
6
6
  require 'rubygems/package'
7
7
  require 'archive/tar/minitar'
8
8
  require 'uri'
9
+ require 'open-uri'
9
10
 
10
11
  # The top-level module for this gem. It's purpose is to hold global
11
12
  # configuration variables that are used as defaults in other classes.
data/lib/docker/error.rb CHANGED
@@ -31,4 +31,7 @@ module Docker::Error
31
31
 
32
32
  # Raised when login fails.
33
33
  class AuthenticationError < DockerError; end
34
+
35
+ # Raised when an IO action fails.
36
+ class IOError < DockerError; end
34
37
  end
data/lib/docker/image.rb CHANGED
@@ -136,19 +136,29 @@ class Docker::Image
136
136
  hashes.map { |hash| new(connection, 'id' => hash['name']) }
137
137
  end
138
138
 
139
- # Import an Image from the output of Docker::Container#export.
140
- def import(file, options = {}, connection = Docker.connection)
141
- File.open(file, 'r') do |io|
142
- body = connection.post(
143
- '/images/create',
144
- options.merge('fromSrc' => '-'),
145
- :headers => { 'Content-Type' => 'application/tar',
146
- 'Transfer-Encoding' => 'chunked' }
147
- ) { io.read(Excon.defaults[:chunk_size]).to_s }
148
- new(connection, 'id'=> Docker::Util.parse_json(body)['status'])
139
+ # Import an Image from the output of Docker::Container#export. The first
140
+ # argument may either be a File or URI.
141
+ def import(imp, opts = {}, conn = Docker.connection)
142
+ open(imp) do |io|
143
+ import_stream(opts, conn) do
144
+ io.read(Excon.defaults[:chunk_size]).to_s
145
+ end
149
146
  end
147
+ rescue StandardError
148
+ raise Docker::Error::IOError, "Could not import '#{imp}'"
150
149
  end
151
150
 
151
+ def import_stream(options = {}, connection = Docker.connection, &block)
152
+ body = connection.post(
153
+ '/images/create',
154
+ options.merge('fromSrc' => '-'),
155
+ :headers => { 'Content-Type' => 'application/tar',
156
+ 'Transfer-Encoding' => 'chunked' },
157
+ &block
158
+ )
159
+ new(connection, 'id'=> Docker::Util.parse_json(body)['status'])
160
+ end
161
+
152
162
  # Given a Dockerfile as a string, builds an Image.
153
163
  def build(commands, opts = {}, connection = Docker.connection, &block)
154
164
  body = ""
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.10.2'
3
+ VERSION = '1.10.3'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.10'
@@ -275,22 +275,41 @@ describe Docker::Image do
275
275
 
276
276
  it 'raises an error' do
277
277
  expect { subject.import(file) }
278
- .to raise_error Errno::ENOENT
278
+ .to raise_error(Docker::Error::IOError)
279
279
  end
280
280
  end
281
281
 
282
282
  context 'when the file does exist' do
283
283
  let(:file) { 'spec/fixtures/export.tar' }
284
+ let(:body) { StringIO.new }
284
285
 
285
- before { File.stub(:open).with(file, 'r').and_yield(mock(:read => '')) }
286
+ before { Docker::Image.stub(:open).with(file).and_yield(body) }
286
287
 
287
288
  it 'creates the Image', :vcr do
288
- pending 'This works, but recording a streaming request breaks VCR'
289
289
  import = subject.import(file)
290
290
  import.should be_a Docker::Image
291
291
  import.id.should_not be_nil
292
292
  end
293
293
  end
294
+
295
+ context 'when the argument is a URI' do
296
+ context 'when the URI is invalid' do
297
+ it 'raises an error', :vcr do
298
+ expect { subject.import('http://google.com') }
299
+ .to raise_error(Docker::Error::IOError)
300
+ end
301
+ end
302
+
303
+ context 'when the URI is valid' do
304
+ let(:uri) { 'http://swipely-pub.s3.amazonaws.com/ubuntu.tar' }
305
+
306
+ it 'returns an Image', :vcr do
307
+ image = subject.import(uri)
308
+ image.should be_a Docker::Image
309
+ image.id.should_not be_nil
310
+ end
311
+ end
312
+ end
294
313
  end
295
314
 
296
315
  describe '.all' do
data/spec/support/vcr.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'vcr'
2
+ require 'webmock'
2
3
 
3
4
  VCR.configure do |c|
4
5
  c.allow_http_connections_when_no_cassette = false
5
- c.hook_into :excon
6
+ c.hook_into :excon, :webmock
6
7
  c.cassette_library_dir = File.join(File.dirname(__FILE__), '..', 'vcr')
7
8
  c.configure_rspec_metadata!
8
9
  end
@@ -0,0 +1,144 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://google.com/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 301
19
+ message: Moved Permanently
20
+ headers:
21
+ Location:
22
+ - http://www.google.com/
23
+ Content-Type:
24
+ - text/html; charset=UTF-8
25
+ Date:
26
+ - Fri, 21 Mar 2014 20:11:15 GMT
27
+ Expires:
28
+ - Sun, 20 Apr 2014 20:11:15 GMT
29
+ Cache-Control:
30
+ - public, max-age=2592000
31
+ Server:
32
+ - gws
33
+ Content-Length:
34
+ - '219'
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ Alternate-Protocol:
40
+ - 80:quic
41
+ body:
42
+ encoding: UTF-8
43
+ string: "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301
44
+ Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A
45
+ HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n"
46
+ http_version:
47
+ recorded_at: Fri, 21 Mar 2014 20:11:19 GMT
48
+ - request:
49
+ method: get
50
+ uri: http://www.google.com/
51
+ body:
52
+ encoding: US-ASCII
53
+ string: ''
54
+ headers:
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ Accept:
58
+ - "*/*"
59
+ User-Agent:
60
+ - Ruby
61
+ response:
62
+ status:
63
+ code: 200
64
+ message: OK
65
+ headers:
66
+ Date:
67
+ - Fri, 21 Mar 2014 20:11:15 GMT
68
+ Expires:
69
+ - "-1"
70
+ Cache-Control:
71
+ - private, max-age=0
72
+ Content-Type:
73
+ - text/html; charset=ISO-8859-1
74
+ Set-Cookie:
75
+ - NID=67=Vlb8snIxYpxY5tZzIccxxSX93Tp-Kk2h4V0l3Jil6Qv7fGPXDl6fpyijgLA8M7upzNZBUogCx8yi4yj8u8XHYxsNDU3d91kpF5_y4FpNuLdKx343IPieJT1S-XZuJqzh;
76
+ expires=Sat, 20-Sep-2014 20:11:15 GMT; path=/; domain=.google.com; HttpOnly
77
+ - PREF=ID=e9956e864b3c8e0a:FF=0:TM=1395432675:LM=1395432675:S=XCuFngWpuYmW5qaT;
78
+ expires=Sun, 20-Mar-2016 20:11:15 GMT; path=/; domain=.google.com
79
+ P3p:
80
+ - CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657
81
+ for more info."
82
+ Server:
83
+ - gws
84
+ X-Xss-Protection:
85
+ - 1; mode=block
86
+ X-Frame-Options:
87
+ - SAMEORIGIN
88
+ Alternate-Protocol:
89
+ - 80:quic
90
+ Transfer-Encoding:
91
+ - chunked
92
+ body:
93
+ encoding: UTF-8
94
+ string: |-
95
+ <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta content="/images/google_favicon_128.png" itemprop="image"><title>Google</title><script>(function(){
96
+ window.google={kEI:"45wsU-LIHqLcyQHF6YDQBg",getEI:function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI},https:function(){return"https:"==window.location.protocol},kEXPI:"4006,17259,4000116,4007661,4007830,4008067,4008133,4008142,4009033,4009565,4009641,4010297,4010806,4010858,4010899,4011228,4011258,4011679,4012373,4012504,4012507,4013338,4013374,4013414,4013416,4013591,4013723,4013747,4013758,4013787,4013823,4013966,4013979,4014016,4014431,4014515,4014636,4014649,4014671,4014792,4014813,4014991,4015119,4015155,4015234,4015260,4015319,4015444,4015497,4015514,4015517,4015582,4015589,4015637,4015638,4015690,4015772,4015853,4015904,4015991,4016007,4016047,4016062,4016138,4016167,4016193,4016283,4016297,4016304,4016311,4016388,8300007,8300015,8300018,8500149,8500157,10200002,10200012,10200014,10200029,10200030,10200040,10200048,10200053,10200055,10200066,10200083,10200103,10200120,10200134,10200155,10200157",kCSI:{e:"4006,17259,4000116,4007661,4007830,4008067,4008133,4008142,4009033,4009565,4009641,4010297,4010806,4010858,4010899,4011228,4011258,4011679,4012373,4012504,4012507,4013338,4013374,4013414,4013416,4013591,4013723,4013747,4013758,4013787,4013823,4013966,4013979,4014016,4014431,4014515,4014636,4014649,4014671,4014792,4014813,4014991,4015119,4015155,4015234,4015260,4015319,4015444,4015497,4015514,4015517,4015582,4015589,4015637,4015638,4015690,4015772,4015853,4015904,4015991,4016007,4016047,4016062,4016138,4016167,4016193,4016283,4016297,4016304,4016311,4016388,8300007,8300015,8300018,8500149,8500157,10200002,10200012,10200014,10200029,10200030,10200040,10200048,10200053,10200055,10200066,10200083,10200103,10200120,10200134,10200155,10200157",ei:"45wsU-LIHqLcyQHF6YDQBg"},authuser:0,ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(a,b,c,h,k){var d=
97
+ new Image,f=google.lc,e=google.li,g="";d.onerror=d.onload=d.onabort=function(){delete f[e]};f[e]=d;c||-1!=b.search("&ei=")||(g="&ei="+google.getEI(h));c=c||"/"+(k||"gen_204")+"?atyp=i&ct="+a+"&cad="+b+g+"&zx="+google.time();a=/^http:/i;a.test(c)&&google.https()?(google.ml(Error("GLMM"),!1,{src:c}),delete f[e]):(d.src=c,google.li=e+1)},lc:[],li:0,y:{},x:function(a,b){google.y[a.id]=[a,b];return!1},load:function(a,b,c){google.x({id:a+l++},function(){google.load(a,b,c)})}};var l=0;})();
98
+ (function(){google.sn="webhp";google.timers={};google.startTick=function(a,b){google.timers[a]={t:{start:google.time()},bfr:!!b}};google.tick=function(a,b,g){google.timers[a]||google.startTick(a);google.timers[a].t[b]=g||google.time()};google.startTick("load",!0);
99
+ try{}catch(d){}})();
100
+ var _gjwl=location;function _gjuc(){var a=_gjwl.href.indexOf("#");if(0<=a&&(a=_gjwl.href.substring(a),0<a.indexOf("&q=")||0<=a.indexOf("#q="))&&(a=a.substring(1),-1==a.indexOf("#"))){for(var d=0;d<a.length;){var b=d;"&"==a.charAt(b)&&++b;var c=a.indexOf("&",b);-1==c&&(c=a.length);b=a.substring(b,c);if(0==b.indexOf("fp="))a=a.substring(0,d)+a.substring(c,a.length),c=d;else if("cad=h"==b)return 0;d=c}_gjwl.href="/search?"+a+"&cad=h";return 1}return 0}
101
+ function _gjh(){!_gjuc()&&window.google&&google.x&&google.x({id:"GJH"},function(){google.nav&&google.nav.gjh&&google.nav.gjh()})};
102
+ window._gjh&&_gjh();</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}</style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#36c}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}a.gb1,a.gb2,a.gb3,a.gb4{color:#11c !important}body{background:#fff;color:black}a{color:#11c;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1,a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}#ghead a.gb2:hover{color:#fff !important}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px}.lsbb{display:block}.ftl,#fll a{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}.lsb:active{background:#ccc}.lst:focus{outline:none}#addlang a{padding:0 3px}</style><script></script></head><body bgcolor="#fff"><script>(function(){var src='/images/nav_logo176.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
103
+ if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
104
+ }
105
+ })();</script><textarea id="csi" style="display:none"></textarea><div id="mngb"> <div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="http://www.google.com/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="http://maps.google.com/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=en&tab=w8">Play</a> <a class=gb1 href="http://www.youtube.com/?tab=w1">YouTube</a> <a class=gb1 href="http://news.google.com/nwshp?hl=en&tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="http://www.google.com/intl/en/options/"><u>More</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.com/history/optout?hl=en" class=gb4>Web History</a> | <a href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.com/" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div> </div><center><br clear="all" id="lgpd"><div id="lga"><img alt="Google" height="95" src="/images/srpr/logo9w.png" style="padding:28px 0 14px" width="269" id="hplogo" onload="window.lol&&lol()"><br><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap=""><input name="ie" value="ISO-8859-1" type="hidden"><input value="en" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><div class="ds" style="height:32px;margin:4px 0"><input style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top" autocomplete="off" class="lst" value="" title="Google Search" maxlength="2048" name="q" size="57"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" value="I'm Feeling Lucky" name="btnI" onclick="if(this.form.q.value)this.checked=1; else top.location='/doodles/'" type="submit"></span></span></td><td class="fl sblc" align="left" nowrap="" width="25%"><a href="/advanced_search?hl=en&amp;authuser=0">Advanced search</a><a href="/language_tools?hl=en&amp;authuser=0">Language tools</a></td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="fll"><a href="/intl/en/ads/">Advertising&nbsp;Programs</a><a href="/services/">Business Solutions</a><a href="https://plus.google.com/116899029375914044550" rel="publisher">+Google</a><a href="/intl/en/about.html">About Google</a></div></div><p style="color:#767676;font-size:8pt">&copy; 2013 - <a href="/intl/en/policies/">Privacy & Terms</a></p></span></center><div id=xjsd></div><div id=xjsi data-jiis="bp"><script>if(google.y)google.y.first=[];(function(){function b(a){window.setTimeout(function(){var c=document.createElement("script");c.src=a;document.getElementById("xjsd").appendChild(c)},0)}google.dljp=function(a){google.xjsu=a;b(a)};google.dlj=b;})();
106
+ if(!google.xjs){window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/k\x3dxjs.hp.en_US.X67G-1Nbjpc.O/m\x3dsb_he,pcc/rt\x3dj/d\x3d1/sv\x3d1/rs\x3dAItRSTO_vkVhEK6twEUdYclvmSrFcRL-Zw');google.xjs=1;}google.pmc={"sb_he":{"agen":true,"cgen":true,"client":"heirloom-hp","dh":true,"ds":"","eqch":true,"fl":true,"host":"google.com","jsonp":true,"msgs":{"dym":"Did you mean:","lcky":"I\u0026#39;m Feeling Lucky","lml":"Learn more","oskt":"Input tools","psrc":"This search was removed from your \u003Ca href=\"/history\"\u003EWeb History\u003C/a\u003E","psrl":"Remove","sbit":"Search by image","srch":"Google Search"},"ovr":{},"pq":"","qcpw":false,"scd":10,"sce":5,"stok":"77Ky_m1xumgNELaxgYSWyY2PMaw"},"pcc":{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}</script></div><script>(function(){if(google.timers&&google.timers.load.t){var b,c,d,e,g=function(a,f){a.removeEventListener?(a.removeEventListener("load",f,!1),a.removeEventListener("error",f,!1)):(a.detachEvent("onload",f),a.detachEvent("onerror",f))},h=function(a){e=(new Date).getTime();++c;a=a||window.event;a=a.target||a.srcElement;g(a,h)},k=document.getElementsByTagName("img");b=k.length;for(var l=c=0,m;l<b;++l)m=k[l],m.complete||"string"!=typeof m.src||!m.src?++c:m.addEventListener?(m.addEventListener("load",h,!1),m.addEventListener("error",
107
+ h,!1)):(m.attachEvent("onload",h),m.attachEvent("onerror",h));d=b-c;var n=function(){if(google.timers.load.t){google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=e;google.kCSI.imc=c;google.kCSI.imn=b;google.kCSI.imp=d;void 0!==google.stt&&(google.kCSI.stt=google.stt);google.csiReport&&google.csiReport()}};window.addEventListener?window.addEventListener("load",n,!1):window.attachEvent&&
108
+ window.attachEvent("onload",n);google.timers.load.t.prt=e=(new Date).getTime()};})();
109
+ </script></body></html>
110
+ http_version:
111
+ recorded_at: Fri, 21 Mar 2014 20:11:19 GMT
112
+ - request:
113
+ method: post
114
+ uri: unix:///var/run/docker.sock/v1.10/images/create?fromSrc=-
115
+ body:
116
+ encoding: US-ASCII
117
+ string: ''
118
+ headers:
119
+ User-Agent:
120
+ - Swipely/Docker-API 1.10.2
121
+ Content-Type:
122
+ - application/tar
123
+ Transfer-Encoding:
124
+ - chunked
125
+ response:
126
+ status:
127
+ code: 500
128
+ message:
129
+ headers:
130
+ Content-Type:
131
+ - text/plain; charset=utf-8
132
+ Date:
133
+ - Fri, 21 Mar 2014 20:11:20 GMT
134
+ Content-Length:
135
+ - '32'
136
+ Connection:
137
+ - close
138
+ body:
139
+ encoding: UTF-8
140
+ string: |
141
+ archive/tar: invalid tar header
142
+ http_version:
143
+ recorded_at: Fri, 21 Mar 2014 20:11:20 GMT
144
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swipely-pub.s3.amazonaws.com/ubuntu.tar
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ X-Amz-Id-2:
22
+ - gDzbfLKbcGI0aVhR6ZPCtlGh6XdtjCg8B1Q6kv45cNhLAmJ0TqX9nN1UDc6G9bc8
23
+ X-Amz-Request-Id:
24
+ - 8A710A4CEED81061
25
+ Date:
26
+ - Fri, 21 Mar 2014 20:09:59 GMT
27
+ X-Amz-Meta-S3cmd-Attrs:
28
+ - uid:1000/gname:thulihan/uname:thulihan/gid:1000/mode:33188/mtime:1395427962/atime:1395427960/md5:dd5c4a8854498b18f70022b98231f10e/ctime:1395427962
29
+ Last-Modified:
30
+ - Fri, 21 Mar 2014 18:53:20 GMT
31
+ Etag:
32
+ - "\"378fd3b78cc4f5afee7e47e9a948ef3f-14\""
33
+ Accept-Ranges:
34
+ - bytes
35
+ Content-Type:
36
+ - application/x-tar
37
+ Content-Length:
38
+ - '215523328'
39
+ Server:
40
+ - AmazonS3
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: !binary |-
44
+ Li8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
45
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
46
+ AAAAAAAAAAAAADAwNDA3NTUAMDAwMDAwMAAwMDAwMDAwADAwMDAwMDAwMDAw
47
+ ADEyMzEzMTA1MTQ3ADAwNzQwMgAgNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
48
+ http_version:
49
+ recorded_at: Fri, 21 Mar 2014 20:10:55 GMT
50
+ - request:
51
+ method: post
52
+ uri: unix:///var/run/docker.sock/v1.10/images/create?fromSrc=-
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ User-Agent:
58
+ - Swipely/Docker-API 1.10.2
59
+ Content-Type:
60
+ - application/tar
61
+ Transfer-Encoding:
62
+ - chunked
63
+ response:
64
+ status:
65
+ code: 200
66
+ message:
67
+ headers:
68
+ Content-Type:
69
+ - application/json
70
+ Date:
71
+ - Fri, 21 Mar 2014 20:10:59 GMT
72
+ Connection:
73
+ - close
74
+ Transfer-Encoding:
75
+ - ''
76
+ body:
77
+ encoding: UTF-8
78
+ string: "{\"status\":\"334a5c3837719bdc4872d1356a1c0ba72c0ad8ac2793979f136f8247180b3436\"}\r\n"
79
+ http_version:
80
+ recorded_at: Fri, 21 Mar 2014 20:10:59 GMT
81
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,34 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: unix:///var/run/docker.sock/v1.10/images/create?fromSrc=-
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Swipely/Docker-API 1.10.2
12
+ Content-Type:
13
+ - application/tar
14
+ Transfer-Encoding:
15
+ - chunked
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ Content-Type:
22
+ - application/json
23
+ Date:
24
+ - Fri, 21 Mar 2014 19:20:00 GMT
25
+ Connection:
26
+ - close
27
+ Transfer-Encoding:
28
+ - ''
29
+ body:
30
+ encoding: UTF-8
31
+ string: "{\"status\":\"98464da2f481d80419b9c79758b804f9589aa0bc94f935f7a7acb009d1cfffec\"}\r\n"
32
+ http_version:
33
+ recorded_at: Fri, 21 Mar 2014 19:20:00 GMT
34
+ recorded_with: VCR 2.8.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: webmock
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: A simple REST client for the Docker Remote API
140
154
  email:
141
155
  - tomhulihan@swipely.com
@@ -214,6 +228,9 @@ files:
214
228
  - spec/vcr/Docker_Image/_create/when_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/sets_the_id_and_sends_Docker_creds.yml
215
229
  - spec/vcr/Docker_Image/_get/when_the_image_does_exist/returns_the_new_image.yml
216
230
  - spec/vcr/Docker_Image/_history/returns_the_history_of_the_Image.yml
231
+ - spec/vcr/Docker_Image/_import/when_the_argument_is_a_URI/when_the_URI_is_invalid/raises_an_error.yml
232
+ - spec/vcr/Docker_Image/_import/when_the_argument_is_a_URI/when_the_URI_is_valid/returns_an_Image.yml
233
+ - spec/vcr/Docker_Image/_import/when_the_file_does_exist/creates_the_Image.yml
217
234
  - spec/vcr/Docker_Image/_insert/inserts_the_url_s_file_into_a_new_Image.yml
218
235
  - spec/vcr/Docker_Image/_insert_local/when_removing_intermediate_containers/creates_a_new_image.yml
219
236
  - spec/vcr/Docker_Image/_insert_local/when_removing_intermediate_containers/leave_no_intermediate_containers.yml
@@ -304,6 +321,9 @@ test_files:
304
321
  - spec/vcr/Docker_Image/_create/when_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/sets_the_id_and_sends_Docker_creds.yml
305
322
  - spec/vcr/Docker_Image/_get/when_the_image_does_exist/returns_the_new_image.yml
306
323
  - spec/vcr/Docker_Image/_history/returns_the_history_of_the_Image.yml
324
+ - spec/vcr/Docker_Image/_import/when_the_argument_is_a_URI/when_the_URI_is_invalid/raises_an_error.yml
325
+ - spec/vcr/Docker_Image/_import/when_the_argument_is_a_URI/when_the_URI_is_valid/returns_an_Image.yml
326
+ - spec/vcr/Docker_Image/_import/when_the_file_does_exist/creates_the_Image.yml
307
327
  - spec/vcr/Docker_Image/_insert/inserts_the_url_s_file_into_a_new_Image.yml
308
328
  - spec/vcr/Docker_Image/_insert_local/when_removing_intermediate_containers/creates_a_new_image.yml
309
329
  - spec/vcr/Docker_Image/_insert_local/when_removing_intermediate_containers/leave_no_intermediate_containers.yml