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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/docker/cli/command_factory.rb +52 -1
- data/lib/docker/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912ed36bbf4af8545851cad5d1e13b310ec2161d1e2995b3d14eea11063cdb1d
|
4
|
+
data.tar.gz: f5698251e25d267c05b20560c5b1c3ea9a9e283c3840bf61fbb727dc916400a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
-
|
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
|
data/lib/docker/cli/version.rb
CHANGED