docker-cli 0.5.3 → 0.5.4

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
  SHA256:
3
- metadata.gz: b234371c64bfb6a69ca9cf2a4a43541a67f58c8b6ce54fb5faea454e0d4e6304
4
- data.tar.gz: efa05c9e71c1453bf9158231ceb1a8d787002db490f35f5f5870e6c7811aea17
3
+ metadata.gz: 912ed36bbf4af8545851cad5d1e13b310ec2161d1e2995b3d14eea11063cdb1d
4
+ data.tar.gz: f5698251e25d267c05b20560c5b1c3ea9a9e283c3840bf61fbb727dc916400a9
5
5
  SHA512:
6
- metadata.gz: d968c60f3d495a8740db3594fefef554e6d157343382201878f22a68275230d0e309e4c74333fec705ce0008a70871c7f16bd25b3ea082b5b1adb2cd700ac2a9
7
- data.tar.gz: 292c4166ab118cadb16b017fc71d92d0c55e91b979985335f7a809d24a42bc03aa61f194fe9e7a8201105d3e71365d7b6764f7f8d2d973cd2caa401f25d75d25
6
+ metadata.gz: 2b9757293262e5b10a00053a4a3f8b32f4ba4fc58e05c83202d25700677d92ffd72dc7c85408038daa1635a7895456262bddc527df806104c19db276da4c8bd7
7
+ data.tar.gz: 6564c0630816fca1d6de450e5e25dc8b830045e2484ca001810d13c0e014488afecf10aa2fe65188b896d681fa25cb0da1b10ea895fa2314e6163fcd8b84bf46
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docker-cli (0.5.3)
4
+ docker-cli (0.5.4)
5
5
  colorize (~> 1.1)
6
6
  ptools (~> 1.4.3)
7
7
  teLogger (~> 0.2)
@@ -44,7 +44,7 @@ GEM
44
44
  rspec-support (~> 3.13.0)
45
45
  rspec-support (3.13.1)
46
46
  teLogger (0.2.2)
47
- toolrack (0.24.2)
47
+ toolrack (0.24.3)
48
48
  tty-color (0.6.0)
49
49
  tty-command (0.10.1)
50
50
  pastel (~> 0.8)
@@ -134,7 +134,12 @@ module Docker
134
134
  cmd << "-d" if opts[:detached] == true
135
135
  cmd << "--rm" if opts[:del] == true
136
136
  if not (opts[:container_name].nil? or opts[:container_name].empty?)
137
- cmd << "--name \"#{opts[:container_name]}\""
137
+ if TR::RTUtils.on_mac?
138
+ # double '\' is required when forking new terminal on mac
139
+ cmd << "--name \\\"#{opts[:container_name]}\\\""
140
+ else
141
+ cmd << "--name \"#{opts[:container_name]}\""
142
+ end
138
143
  end
139
144
 
140
145
  cmd << process_mount(opts)
@@ -217,6 +222,52 @@ module Docker
217
222
  end
218
223
 
219
224
 
225
+ def create_network(network_name, opts = { })
226
+ cmd = []
227
+ cmd << Cli.docker_exe
228
+ cmd << "network"
229
+ cmd << "create"
230
+ cmd << network_name
231
+
232
+ cmd << "--driver=#{opts[:driver]}" if not_empty?(opts[:driver])
233
+
234
+ if not_empty?(opts[:subnet])
235
+ subnet = opts[:subnet]
236
+ if subnet.is_a?(Array)
237
+ cmd += subnet.map { |v| "--subnet=#{v}"}
238
+ else
239
+ cmd << "--subnet=#{opts[:subnet]}"
240
+ end
241
+ end
242
+
243
+ if not_empty?(opts[:gateway])
244
+ gateway = opts[:gateway]
245
+ if gateway.is_a?(Array)
246
+ cmd += gateway.map { |v| "--gateway=#{v}"}
247
+ else
248
+ cmd << "--gateway=#{opts[:gateway]}"
249
+ end
250
+ end
251
+
252
+ cmd << "--ip-range=#{opts[:ip_range]}" if not_empty?(opts[:ip_range])
253
+
254
+ logger.debug "Create Network : #{cmd.join(" ")}"
255
+ Command.new(cmd)
256
+ end
257
+
258
+
259
+ def remove_network(name)
260
+ cmd = []
261
+ cmd << Cli.docker_exe
262
+ cmd << "network"
263
+ cmd << "rm"
264
+ cmd << name
265
+
266
+ logger.debug "Remove Network : #{cmd.join(" ")}"
267
+ Command.new(cmd)
268
+ end
269
+
270
+
220
271
  def run_command_in_running_container(container, command, opts = { })
221
272
  cmd = []
222
273
  cmd << Cli.docker_exe
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Docker
4
4
  module Cli
5
- VERSION = "0.5.3"
5
+ VERSION = "0.5.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian