docker-cli 0.5.2 → 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 +15 -15
- data/lib/docker/cli/command_factory.rb +61 -1
- data/lib/docker/cli/version.rb +1 -1
- metadata +6 -6
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)
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
15
|
colorize (1.1.0)
|
16
|
-
diff-lcs (1.5.
|
16
|
+
diff-lcs (1.5.1)
|
17
17
|
git_cli (0.13.9)
|
18
18
|
ptools (~> 1.4.0)
|
19
19
|
teLogger (> 0.2)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
pastel (0.8.0)
|
22
22
|
tty-color (~> 0.5)
|
23
23
|
ptools (1.4.3)
|
24
|
-
rake (13.1
|
24
|
+
rake (13.2.1)
|
25
25
|
release-gem (0.3.3)
|
26
26
|
colorize (~> 1.1)
|
27
27
|
git_cli (~> 0.13)
|
@@ -30,21 +30,21 @@ GEM
|
|
30
30
|
toolrack (~> 0.23)
|
31
31
|
tty-command (~> 0.10)
|
32
32
|
tty-prompt (~> 0.23)
|
33
|
-
rspec (3.
|
34
|
-
rspec-core (~> 3.
|
35
|
-
rspec-expectations (~> 3.
|
36
|
-
rspec-mocks (~> 3.
|
37
|
-
rspec-core (3.
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-expectations (3.
|
33
|
+
rspec (3.13.0)
|
34
|
+
rspec-core (~> 3.13.0)
|
35
|
+
rspec-expectations (~> 3.13.0)
|
36
|
+
rspec-mocks (~> 3.13.0)
|
37
|
+
rspec-core (3.13.0)
|
38
|
+
rspec-support (~> 3.13.0)
|
39
|
+
rspec-expectations (3.13.0)
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-mocks (3.
|
41
|
+
rspec-support (~> 3.13.0)
|
42
|
+
rspec-mocks (3.13.0)
|
43
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-support (3.
|
44
|
+
rspec-support (~> 3.13.0)
|
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,11 +134,17 @@ 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)
|
141
146
|
cmd << process_port(opts)
|
147
|
+
cmd << process_network(opts)
|
142
148
|
|
143
149
|
if opts[:match_user] == true
|
144
150
|
ui = UserInfo.user_info
|
@@ -216,6 +222,52 @@ module Docker
|
|
216
222
|
end
|
217
223
|
|
218
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
|
+
|
219
271
|
def run_command_in_running_container(container, command, opts = { })
|
220
272
|
cmd = []
|
221
273
|
cmd << Cli.docker_exe
|
@@ -286,6 +338,14 @@ module Docker
|
|
286
338
|
|
287
339
|
end
|
288
340
|
|
341
|
+
def process_network(opts)
|
342
|
+
if not_empty?(opts) and not_empty?(opts[:network])
|
343
|
+
"--network=#{opts[:network]}"
|
344
|
+
else
|
345
|
+
""
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
289
349
|
def logger
|
290
350
|
Cli.logger(:cmdFact)
|
291
351
|
end
|
data/lib/docker/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toolrack
|
@@ -159,7 +159,7 @@ files:
|
|
159
159
|
homepage: ''
|
160
160
|
licenses: []
|
161
161
|
metadata: {}
|
162
|
-
post_install_message:
|
162
|
+
post_install_message:
|
163
163
|
rdoc_options: []
|
164
164
|
require_paths:
|
165
165
|
- lib
|
@@ -174,8 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
rubygems_version: 3.5.
|
178
|
-
signing_key:
|
177
|
+
rubygems_version: 3.5.1
|
178
|
+
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: ''
|
181
181
|
test_files: []
|