linecook-gem 0.7.3 → 0.7.4

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: 5e78c53c1e83145109b3ab202160bf5c4faec69f
4
- data.tar.gz: 5a1b403b3f344fe357d5dec040c095c2545e5f9f
3
+ metadata.gz: 1d20dbf64997f7163652432f857f9c40080d040b
4
+ data.tar.gz: 82b2409e86198689a95dc8cc2c04b9cf8ec5ce31
5
5
  SHA512:
6
- metadata.gz: 55302b7abbc4388af5abd732b49d1c76b6ef168621bfe6b32dd3de3bc52f906c9f8264f6c5618a773ada7f1bdb5d8a1ddd67372251a05d545268438706f49cb8
7
- data.tar.gz: 880e4a9b214a59b5b39ec8bd871c9bf6c87f3734aacee5cad896b3b6abcf68ec5de3ce0c4ecf0b759a0d88f8f0452e35aebfb690e7aaac47ee137122ce4cc41d
6
+ metadata.gz: 9bc7266a396e932188848d1d4b7e72aa56a15584181b0f577b12db5e7b88740aa443e341523678ab53709b5a222bef08ae398196fae8f1c8af51b36bb4c55600
7
+ data.tar.gz: 8019f8c7388acbe0de272654f873f5519e0b8aeafa7886a9badeef74210116059ea5c242a21b8cac1d1eac28c3b6a1c1165bfb6818e6ee36e7a006101c899de6
@@ -1,4 +1,3 @@
1
- require 'open3'
2
1
  require 'tmpdir'
3
2
  require 'fileutils'
4
3
 
@@ -21,17 +20,8 @@ module Linecook
21
20
 
22
21
 
23
22
  def save
24
- container.stop
25
23
  FileUtils.mkdir_p(File.dirname(@image.path))
26
- pipe, _, _, _ = Open3.popen3("xz -T 0 -0 > #{@image.path}")
27
-
28
- container.export do |chunk|
29
- pipe.write(chunk)
30
- end
31
-
32
- pipe.flush
33
- pipe.close
34
- container.start
24
+ system("docker export #{@image.id} | xz -T 0 -0 > #{@image.path}")
35
25
  end
36
26
 
37
27
  def instance
@@ -104,11 +94,7 @@ module Linecook
104
94
  def import(image)
105
95
  puts "Importing #{image.id}..."
106
96
  image.fetch
107
- open(image.path) do |io|
108
- ::Docker::Image.import_stream(repo: image.group, tag: image.tag, changes: ['CMD ["/sbin/init"]']) do
109
- io.read(Excon.defaults[:chunk_size] * 10 ) || ""
110
- end
111
- end
97
+ system("docker import -c 'CMD [\"/sbin/init\"]' #{image.path} #{image.group}:#{image.tag}")
112
98
  end
113
99
 
114
100
 
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.7.3'
2
+ VERSION = '0.7.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel