docker_core 0.0.47 → 0.0.49
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 +4 -4
- data/lib/docker_core.rb +13 -19
- 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: '091c0653e6c3e0f2092ec6e23859963f64e84e47a4c145b6324d637c33d6dee9'
|
|
4
|
+
data.tar.gz: ed043df57bb9b5d68abdb3909bb40683d276bed953950260ed4ae474cdba7b89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b51538e23314b1c8527b6e91e3b6d41e0310139335379134364b669d237f40db3a7e0e204a970135df0a3d693b0bf923d189370d405f2e640f057970a0c5df1
|
|
7
|
+
data.tar.gz: 6c92451e4960b171d3dc5d5e7559bc405a893529de5a01a6c6784d4087bea6b7c8432af18887e10545c865346fd03aa78f6ce59e55ae04056f54ea03b459d1ea
|
data/lib/docker_core.rb
CHANGED
|
@@ -320,7 +320,7 @@ module DockerCore
|
|
|
320
320
|
end
|
|
321
321
|
end
|
|
322
322
|
|
|
323
|
-
module
|
|
323
|
+
module System
|
|
324
324
|
# @param [Numeric] second
|
|
325
325
|
def self.wait(second = 0)
|
|
326
326
|
if second.is_a?(Numeric)
|
|
@@ -389,27 +389,21 @@ module DockerCore
|
|
|
389
389
|
end
|
|
390
390
|
|
|
391
391
|
# @param [Array] arguments
|
|
392
|
+
# @param [Boolean] background
|
|
392
393
|
# @param [Boolean, String] sudo
|
|
393
|
-
|
|
394
|
+
# @param [Boolean] echo
|
|
395
|
+
def self.execute(*arguments, background: false, sudo: SUDO, echo: true)
|
|
394
396
|
command = self.command(*arguments, sudo: sudo)
|
|
395
397
|
|
|
396
398
|
if echo
|
|
397
399
|
Color.echo("= #{command}", Color::CYAN)
|
|
398
400
|
end
|
|
399
401
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
# @param [Boolean, String] sudo
|
|
405
|
-
def self.spawn(*arguments, sudo: SUDO, echo: true)
|
|
406
|
-
command = self.command(*arguments, sudo: sudo)
|
|
407
|
-
|
|
408
|
-
if echo
|
|
409
|
-
Color.echo("= #{command}", Color::CYAN)
|
|
402
|
+
if background
|
|
403
|
+
return spawn(command)
|
|
404
|
+
else
|
|
405
|
+
return exec(command)
|
|
410
406
|
end
|
|
411
|
-
|
|
412
|
-
return spawn(command)
|
|
413
407
|
end
|
|
414
408
|
|
|
415
409
|
# @param [String] title
|
|
@@ -433,7 +427,7 @@ module DockerCore
|
|
|
433
427
|
|
|
434
428
|
# @param [String] unit
|
|
435
429
|
def self.is_active_unit(unit)
|
|
436
|
-
return 'active' ==
|
|
430
|
+
return 'active' == System.capture("systemctl is-active #{unit}").downcase
|
|
437
431
|
end
|
|
438
432
|
|
|
439
433
|
# @param [Array<String>] arguments
|
|
@@ -627,10 +621,10 @@ module DockerCore
|
|
|
627
621
|
uid = ENV.fetch('DOCKER_CORE_UID', uid)
|
|
628
622
|
gid = ENV.fetch('DOCKER_CORE_GID', gid)
|
|
629
623
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
624
|
+
System.run('deluser', USER, throw: false)
|
|
625
|
+
System.run('delgroup', GROUP, throw: false)
|
|
626
|
+
System.run('addgroup', { system: true, gid: gid }, GROUP)
|
|
627
|
+
System.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
|
|
634
628
|
end
|
|
635
629
|
|
|
636
630
|
# @param [String] stdout
|