docker-api 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4198f4d7269f99167db53f000f06b8fc7e8ddf98
4
- data.tar.gz: b1152255704ae1a9bf287eaa245108ed7bc42dd3
3
+ metadata.gz: 98aa4229f5b2957ca1a71442d35db07145de35ac
4
+ data.tar.gz: c4823cc1e8841e65f22637734c334f35275c27c3
5
5
  SHA512:
6
- metadata.gz: cd4fcbd671146f21fe9fc1bbc557fc8f030d525f3b92669678d5594a6c8198e135ce03ecd483ed4e4ed360cedf02b284b70dfe4143338585b67e040a42ec2d99
7
- data.tar.gz: 044a9553c549b527fc8f9c924c391eeebf4312a100a5cd75472eb656689c12d83d22a7342af7ab5d6426af954eba15b6d37f00f6681fc490919060f3f2e010d3
6
+ metadata.gz: 231f8d67f44388c1027b93426c179dadc8312f355f994eec189ef98bc3cc2dda7b17673ce2727144423dd9ea23b399d60ed331e797e3241e4c78edf1fc165521
7
+ data.tar.gz: d3531ef538ee76d7358a2a6ee6ed6f2f2da2d9f6d92a7c30a0330b3706d324db5788c9a530eb419077cc6b3d86182115aaecfe3ea78f867ee2c0c0215fd5bbe1
data/.cane CHANGED
@@ -1 +1 @@
1
- --abc-max 12
1
+ --abc-max 13
data/README.md CHANGED
@@ -94,10 +94,15 @@ require 'docker'
94
94
  Docker::Image.create('fromRepo' => 'base')
95
95
  # => Docker::Image { :id => ae7ffbcd1, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
96
96
 
97
- # Insert a file into an Image. Returns a new Image that contains that file.
97
+ # Insert a file into an Image from a url.
98
98
  image.insert('path' => '/google', 'url' => 'http://google.com')
99
99
  # => Docker::Image { :id => 11ef6c882, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
100
100
 
101
+ # Insert a local file into an Image.
102
+ image.insert_local('localPath' => 'Gemfile', 'outputPath' => '/')
103
+ # => Docker::Image { :id => 682ea192f, :connection => Docker::Connection { :url => http://localhost, :options => {:port=>4243} } }
104
+
105
+
101
106
  # Tag an Image.
102
107
  image.tag('repo' => 'base2', 'force' => true)
103
108
  # => nil
@@ -43,6 +43,24 @@ class Docker::Image
43
43
  end
44
44
  end
45
45
 
46
+ # Given a path of a local file and the path it should be inserted, creates
47
+ # a new Image that has that file.
48
+ def insert_local(opts = {})
49
+ local_path = opts.delete('localPath')
50
+ output_path = opts.delete('outputPath')
51
+ if File.exist?(local_path)
52
+ basename = File.basename(local_path)
53
+ tar = Docker::Util.create_tar(
54
+ basename => File.read(local_path),
55
+ 'Dockerfile' => "from #{self.id}\nadd #{basename} #{output_path}"
56
+ )
57
+ body = connection.post('/build', {}, :body => tar)
58
+ self.class.send(:new, connection, Docker::Util.extract_id(body))
59
+ else
60
+ raise ArgumentError, "#{local_path} does not exist."
61
+ end
62
+ end
63
+
46
64
  # Remove the Image from the server.
47
65
  def remove
48
66
  connection.delete("/images/#{self.id}")
@@ -105,50 +123,25 @@ class Docker::Image
105
123
 
106
124
  # Given a Dockerfile as a string, builds an Image.
107
125
  def build(commands, connection = Docker.connection)
108
- body = connection.post('/build', {}, :body => create_tar(commands))
109
- new(connection, extract_id(body))
126
+ body = connection.post(
127
+ '/build', {},
128
+ :body => Docker::Util.create_tar('Dockerfile' => commands)
129
+ )
130
+ new(connection, Docker::Util.extract_id(body))
110
131
  end
111
132
 
112
133
  # Given a directory that contains a Dockerfile, builds an Image.
113
134
  def build_from_dir(dir, connection = Docker.connection)
114
- tar = create_dir_tar(dir)
135
+ tar = Docker::Util.create_dir_tar(dir)
115
136
  body = connection.post(
116
137
  '/build', {},
117
138
  :headers => { 'Content-Type' => 'application/tar',
118
139
  'Transfer-Encoding' => 'chunked' }
119
140
  ) { tar.read(Excon.defaults[:chunk_size]).to_s }
120
- new(connection, extract_id(body))
141
+ new(connection, Docker::Util.extract_id(body))
121
142
  ensure
122
143
  tar.close unless tar.nil?
123
144
  end
124
-
125
- private
126
- def extract_id(body)
127
- line = body.lines.to_a[-1]
128
- if (id = line.match(/^Successfully built ([a-f0-9]+)$/)) && !id[1].empty?
129
- id[1]
130
- else
131
- raise UnexpectedResponseError, "Couldn't find id: #{body}"
132
- end
133
- end
134
-
135
- def create_tar(input)
136
- output = StringIO.new
137
- Gem::Package::TarWriter.new(output) do |tar|
138
- tar.add_file('Dockerfile', 0640) { |tar_file| tar_file.write(input) }
139
- end
140
- output.tap(&:rewind)
141
- end
142
-
143
- def create_dir_tar(directory)
144
- cwd = FileUtils.pwd
145
- tempfile = File.new('/tmp/out', 'wb')
146
- FileUtils.cd(directory)
147
- Archive::Tar::Minitar.pack('.', tempfile)
148
- File.new('/tmp/out', 'r')
149
- ensure
150
- FileUtils.cd(cwd)
151
- end
152
145
  end
153
146
 
154
147
  # Convenience method to return the path for a particular resource.
@@ -9,5 +9,34 @@ module Docker::Util
9
9
  raise UnexpectedResponseError, ex.message
10
10
  end
11
11
 
12
- module_function :parse_json
12
+ def create_tar(hash = {})
13
+ output = StringIO.new
14
+ Gem::Package::TarWriter.new(output) do |tar|
15
+ hash.each do |file_name, input|
16
+ tar.add_file(file_name, 0640) { |tar_file| tar_file.write(input) }
17
+ end
18
+ end
19
+ output.tap(&:rewind)
20
+ end
21
+
22
+ def create_dir_tar(directory)
23
+ cwd = FileUtils.pwd
24
+ tempfile = File.new('/tmp/out', 'wb')
25
+ FileUtils.cd(directory)
26
+ Archive::Tar::Minitar.pack('.', tempfile)
27
+ File.new('/tmp/out', 'r')
28
+ ensure
29
+ FileUtils.cd(cwd)
30
+ end
31
+
32
+ def extract_id(body)
33
+ line = body.lines.to_a[-1]
34
+ if (id = line.match(/^Successfully built ([a-f0-9]+)$/)) && !id[1].empty?
35
+ id[1]
36
+ else
37
+ raise UnexpectedResponseError, "Couldn't find id: #{body}"
38
+ end
39
+ end
40
+
41
+ module_function :parse_json, :create_tar, :create_dir_tar, :extract_id
13
42
  end
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.2'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.4'
@@ -40,6 +40,33 @@ describe Docker::Image do
40
40
  end
41
41
  end
42
42
 
43
+ describe '#insert_local' do
44
+ subject { described_class.build('from base') }
45
+
46
+ let(:new_image) {
47
+ subject.insert_local('localPath' => file, 'outputPath' => '/')
48
+ }
49
+
50
+ context 'when the local file does not exist' do
51
+ let(:file) { '/lol/not/a/file' }
52
+
53
+ it 'raises an error', :vcr do
54
+ expect { new_image }.to raise_error(Docker::Error::ArgumentError)
55
+ end
56
+ end
57
+
58
+ context 'when the local file does exist' do
59
+ let(:file) { './Gemfile' }
60
+ let(:gemfile) { File.read('Gemfile') }
61
+
62
+ it 'creates a new Image that has that file', :vcr do
63
+ new_image.run('cat /Gemfile').start.attach { |chunk|
64
+ chunk.should == gemfile
65
+ }
66
+ end
67
+ end
68
+ end
69
+
43
70
  describe '#push' do
44
71
  subject { described_class.create('fromImage' => 'base') }
45
72
 
@@ -0,0 +1,288 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:4243/v1.4/build
6
+ body:
7
+ encoding: UTF-8
8
+ string: !binary |-
9
+ RG9ja2VyZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
10
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
11
+ AAAAAAAAAAAAADAwMDA2NDAAMDAwMDAwMAAwMDAwMDAwADAwMDAwMDAwMDEx
12
+ ADAwMDAwMDAwMDAwADAxMzIzNQAgMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
13
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
14
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1c3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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
47
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
48
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
49
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
50
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
51
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
52
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
53
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
54
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
55
+ headers:
56
+ User-Agent:
57
+ - Swipely/Docker-API 1.5.1
58
+ Content-Type:
59
+ - application/json
60
+ response:
61
+ status:
62
+ code: 200
63
+ message: ''
64
+ headers:
65
+ Content-Type:
66
+ - text/plain; charset=utf-8
67
+ Date:
68
+ - Fri, 30 Aug 2013 19:10:51 GMT
69
+ Transfer-Encoding:
70
+ - chunked
71
+ body:
72
+ encoding: UTF-8
73
+ string: |
74
+ Step 1 : FROM base
75
+ ---> b750fe79269d
76
+ Successfully built b750fe79269d
77
+ http_version:
78
+ recorded_at: Fri, 30 Aug 2013 19:10:51 GMT
79
+ - request:
80
+ method: post
81
+ uri: http://localhost:4243/v1.4/build
82
+ body:
83
+ encoding: UTF-8
84
+ string: !binary |-
85
+ R2VtZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
86
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAA
150
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
151
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
152
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
153
+ AAAAAAAAAAAAAAAA
154
+ headers:
155
+ User-Agent:
156
+ - Swipely/Docker-API 1.5.1
157
+ Content-Type:
158
+ - application/json
159
+ response:
160
+ status:
161
+ code: 200
162
+ message: ''
163
+ headers:
164
+ Content-Type:
165
+ - text/plain; charset=utf-8
166
+ Date:
167
+ - Fri, 30 Aug 2013 19:10:51 GMT
168
+ Transfer-Encoding:
169
+ - chunked
170
+ body:
171
+ encoding: UTF-8
172
+ string: |
173
+ Step 1 : FROM b750fe79269d
174
+ ---> b750fe79269d
175
+ Step 2 : ADD Gemfile /
176
+ ---> eed61e263f7d
177
+ Successfully built eed61e263f7d
178
+ http_version:
179
+ recorded_at: Fri, 30 Aug 2013 19:10:51 GMT
180
+ - request:
181
+ method: post
182
+ uri: http://localhost:4243/v1.4/containers/create
183
+ body:
184
+ encoding: UTF-8
185
+ string: '{"Image":"eed61e263f7d","Cmd":["cat","/Gemfile"]}'
186
+ headers:
187
+ User-Agent:
188
+ - Swipely/Docker-API 1.5.1
189
+ Content-Type:
190
+ - application/json
191
+ response:
192
+ status:
193
+ code: 201
194
+ message: ''
195
+ headers:
196
+ Content-Type:
197
+ - text/plain; charset=utf-8
198
+ Content-Length:
199
+ - '21'
200
+ Date:
201
+ - Fri, 30 Aug 2013 19:10:51 GMT
202
+ body:
203
+ encoding: UTF-8
204
+ string: '{"Id":"d2060f8c9a82"}'
205
+ http_version:
206
+ recorded_at: Fri, 30 Aug 2013 19:10:51 GMT
207
+ - request:
208
+ method: post
209
+ uri: http://localhost:4243/v1.4/containers/d2060f8c9a82/start
210
+ body:
211
+ encoding: UTF-8
212
+ string: '{}'
213
+ headers:
214
+ User-Agent:
215
+ - Swipely/Docker-API 1.5.1
216
+ Content-Type:
217
+ - application/json
218
+ response:
219
+ status:
220
+ code: 204
221
+ message: ''
222
+ headers:
223
+ Content-Type:
224
+ - text/plain; charset=utf-8
225
+ Content-Length:
226
+ - '0'
227
+ Date:
228
+ - Fri, 30 Aug 2013 19:10:51 GMT
229
+ body:
230
+ encoding: UTF-8
231
+ string: ''
232
+ http_version:
233
+ recorded_at: Fri, 30 Aug 2013 19:10:51 GMT
234
+ - request:
235
+ method: post
236
+ uri: http://localhost:4243/v1.4/containers/d2060f8c9a82/start
237
+ body:
238
+ encoding: UTF-8
239
+ string: '{}'
240
+ headers:
241
+ User-Agent:
242
+ - Swipely/Docker-API 1.5.1
243
+ Content-Type:
244
+ - application/json
245
+ response:
246
+ status:
247
+ code: 500
248
+ message: ''
249
+ headers:
250
+ Content-Type:
251
+ - text/plain; charset=utf-8
252
+ Content-Length:
253
+ - '138'
254
+ Date:
255
+ - Fri, 30 Aug 2013 19:10:51 GMT
256
+ body:
257
+ encoding: UTF-8
258
+ string: |
259
+ Error starting container d2060f8c9a82: The container d2060f8c9a82e54e0662eeab6eae083513639bdc77c4b4fd9efad94858015c86 is already running.
260
+ http_version:
261
+ recorded_at: Fri, 30 Aug 2013 19:10:51 GMT
262
+ - request:
263
+ method: post
264
+ uri: http://localhost:4243/v1.4/containers/d2060f8c9a82/attach?stdout=true&stream=true
265
+ body:
266
+ encoding: US-ASCII
267
+ string: ''
268
+ headers:
269
+ User-Agent:
270
+ - Swipely/Docker-API 1.5.1
271
+ Content-Type:
272
+ - text/plain
273
+ response:
274
+ status:
275
+ code: 200
276
+ message: ''
277
+ headers:
278
+ Content-Type:
279
+ - application/vnd.docker.raw-stream
280
+ body:
281
+ encoding: UTF-8
282
+ string: |
283
+ source 'http://rubygems.org'
284
+
285
+ gemspec
286
+ http_version:
287
+ recorded_at: Fri, 30 Aug 2013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AAAAAAAAAAAAAAAAAAAA=
55
+ headers:
56
+ User-Agent:
57
+ - Swipely/Docker-API 1.5.1
58
+ Content-Type:
59
+ - application/json
60
+ response:
61
+ status:
62
+ code: 200
63
+ message: ''
64
+ headers:
65
+ Content-Type:
66
+ - text/plain; charset=utf-8
67
+ Date:
68
+ - Fri, 30 Aug 2013 18:43:13 GMT
69
+ Transfer-Encoding:
70
+ - chunked
71
+ body:
72
+ encoding: UTF-8
73
+ string: |
74
+ Step 1 : FROM base
75
+ ---> b750fe79269d
76
+ Successfully built b750fe79269d
77
+ http_version:
78
+ recorded_at: Fri, 30 Aug 2013 18:43:14 GMT
79
+ recorded_with: VCR 2.5.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
@@ -212,6 +212,8 @@ files:
212
212
  - spec/vcr/Docker_Image/_create/when_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/sets_the_id.yml
213
213
  - spec/vcr/Docker_Image/_history/returns_the_history_of_the_Image.yml
214
214
  - spec/vcr/Docker_Image/_insert/inserts_the_url_s_file_into_a_new_Image.yml
215
+ - spec/vcr/Docker_Image/_insert_local/when_the_local_file_does_exist/creates_a_new_Image_that_has_that_file.yml
216
+ - spec/vcr/Docker_Image/_insert_local/when_the_local_file_does_not_exist/raises_an_error.yml
215
217
  - spec/vcr/Docker_Image/_json/returns_additional_information_about_image_image.yml
216
218
  - spec/vcr/Docker_Image/_remove/removes_the_Image.yml
217
219
  - spec/vcr/Docker_Image/_run/when_the_argument_is_a_String/splits_the_String_by_spaces_and_creates_a_new_Container.yml
@@ -282,6 +284,8 @@ test_files:
282
284
  - spec/vcr/Docker_Image/_create/when_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/sets_the_id.yml
283
285
  - spec/vcr/Docker_Image/_history/returns_the_history_of_the_Image.yml
284
286
  - spec/vcr/Docker_Image/_insert/inserts_the_url_s_file_into_a_new_Image.yml
287
+ - spec/vcr/Docker_Image/_insert_local/when_the_local_file_does_exist/creates_a_new_Image_that_has_that_file.yml
288
+ - spec/vcr/Docker_Image/_insert_local/when_the_local_file_does_not_exist/raises_an_error.yml
285
289
  - spec/vcr/Docker_Image/_json/returns_additional_information_about_image_image.yml
286
290
  - spec/vcr/Docker_Image/_remove/removes_the_Image.yml
287
291
  - spec/vcr/Docker_Image/_run/when_the_argument_is_a_String/splits_the_String_by_spaces_and_creates_a_new_Container.yml