dockerun 0.1.14
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 +7 -0
- data/.release_history.yml +30 -0
- data/.rspec +3 -0
- data/Dockerfile.dockerun +19 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +84 -0
- data/README.md +35 -0
- data/Rakefile +10 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/dockerun.gemspec +48 -0
- data/exe/dockerun +86 -0
- data/lib/dockerun/cli_prompt.rb +17 -0
- data/lib/dockerun/command/dockerun.rb +30 -0
- data/lib/dockerun/command/init.rb +75 -0
- data/lib/dockerun/command/remove_container.rb +99 -0
- data/lib/dockerun/command/reset_image.rb +107 -0
- data/lib/dockerun/command/run.rb +135 -0
- data/lib/dockerun/command/run_new_container.rb +94 -0
- data/lib/dockerun/command/run_new_image.rb +89 -0
- data/lib/dockerun/config.rb +97 -0
- data/lib/dockerun/docker_command_factory_helper.rb +15 -0
- data/lib/dockerun/docker_container_helper.rb +111 -0
- data/lib/dockerun/docker_image_helper.rb +173 -0
- data/lib/dockerun/template/general_template_writer.rb +14 -0
- data/lib/dockerun/template/jruby_template_writer.rb +24 -0
- data/lib/dockerun/template/template_engine.rb +21 -0
- data/lib/dockerun/template/template_writer.rb +63 -0
- data/lib/dockerun/template/template_writter.rb +58 -0
- data/lib/dockerun/template_engine.rb +14 -0
- data/lib/dockerun/user_info.rb +37 -0
- data/lib/dockerun/version.rb +5 -0
- data/lib/dockerun.rb +22 -0
- data/template/Dockerfile_general.erb +12 -0
- data/template/Dockerfile_jruby-9.4.0-jdk11.erb +21 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6626fb24f14182ca40924b86c645115f4a18d14da1d48cfd9832fb85b7aebf47
|
4
|
+
data.tar.gz: 4a19edb06eb072198af2ee92db3a6aa7e3d086ce3057940530abd5379defcc54
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3e0f07f26555f30b7fa03ae2e17f84adb3a1430db7ce1d8ad6ae228e2604f896d00744ec7c56fc90294e07d1dfc115ee9782b6035975615d7383cb7d2a831334
|
7
|
+
data.tar.gz: d623e2f25169ee8a137c14b8aaeac5192f71f1e836b9740d3d93956e530338de854497ae752a1ea8105b92bf1c7f500b8d22353e3ff2308d55ca6e9fc3d2a182
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
dockerun:
|
3
|
+
- :version: 0.1.0
|
4
|
+
:timestamp: 1670316183.6472232
|
5
|
+
- :version: 0.1.1
|
6
|
+
:timestamp: 1670316312.4779773
|
7
|
+
- :version: 0.1.2
|
8
|
+
:timestamp: 1670322141.4019918
|
9
|
+
- :version: 0.1.3
|
10
|
+
:timestamp: 1670322571.6620317
|
11
|
+
- :version: 0.1.4
|
12
|
+
:timestamp: 1670322830.4816852
|
13
|
+
- :version: 0.1.5
|
14
|
+
:timestamp: 1670421296.0570104
|
15
|
+
- :version: 0.1.6
|
16
|
+
:timestamp: 1670421483.0685005
|
17
|
+
- :version: 0.1.7
|
18
|
+
:timestamp: 1670557200.7343419
|
19
|
+
- :version: 0.1.8
|
20
|
+
:timestamp: 1670557489.8592377
|
21
|
+
- :version: 0.1.9
|
22
|
+
:timestamp: 1670557778.5624037
|
23
|
+
- :version: 0.1.10
|
24
|
+
:timestamp: 1670579289.0579133
|
25
|
+
- :version: 0.1.11
|
26
|
+
:timestamp: 1670640649.1748028
|
27
|
+
- :version: 0.1.12
|
28
|
+
:timestamp: 1670640902.591357
|
29
|
+
- :version: 0.1.13
|
30
|
+
:timestamp: 1670649972.645625
|
data/.rspec
ADDED
data/Dockerfile.dockerun
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
FROM jruby:9.4.0-jdk11
|
3
|
+
LABEL version="0.1" description="Dockerfile generated by dockerun" maintainer="chris"
|
4
|
+
|
5
|
+
# Dockerfile entries here
|
6
|
+
RUN apt-get update && apt-get install -y sudo
|
7
|
+
|
8
|
+
RUN groupadd -f -g 1000 chris && \
|
9
|
+
useradd -u 1000 -g 1000 -m chris && \
|
10
|
+
usermod -aG sudo chris && \
|
11
|
+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
12
|
+
|
13
|
+
USER chris
|
14
|
+
|
15
|
+
RUN sudo apt-get install -y curl git
|
16
|
+
|
17
|
+
# ENTRYPOINT [ "/bin/bash" ]
|
18
|
+
# CMD [ "/bin/bash", "--login" ]
|
19
|
+
CMD [ "/bin/bash", "--login" ]
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dockerun (0.1.12)
|
5
|
+
docker-cli
|
6
|
+
teLogger (~> 0.2.0)
|
7
|
+
toolrack (~> 0.19.1)
|
8
|
+
tty-command (~> 0.10.1)
|
9
|
+
tty-option (~> 0.2.0)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
base58 (0.2.3)
|
15
|
+
devops_assist (0.3.1)
|
16
|
+
git_cli
|
17
|
+
git_cli_prompt
|
18
|
+
gvcs
|
19
|
+
teLogger
|
20
|
+
toolrack
|
21
|
+
tty-prompt
|
22
|
+
diff-lcs (1.5.0)
|
23
|
+
docker-cli (0.1.1)
|
24
|
+
ptools
|
25
|
+
teLogger
|
26
|
+
toolrack
|
27
|
+
tty-command
|
28
|
+
tty-prompt
|
29
|
+
git_cli (0.10.0)
|
30
|
+
gvcs
|
31
|
+
ptools (~> 1.4.0)
|
32
|
+
teLogger
|
33
|
+
toolrack
|
34
|
+
git_cli_prompt (0.3.1)
|
35
|
+
teLogger
|
36
|
+
toolrack
|
37
|
+
tty-prompt
|
38
|
+
gvcs (0.1.0)
|
39
|
+
pastel (0.8.0)
|
40
|
+
tty-color (~> 0.5)
|
41
|
+
ptools (1.4.3)
|
42
|
+
rake (13.0.6)
|
43
|
+
rspec (3.12.0)
|
44
|
+
rspec-core (~> 3.12.0)
|
45
|
+
rspec-expectations (~> 3.12.0)
|
46
|
+
rspec-mocks (~> 3.12.0)
|
47
|
+
rspec-core (3.12.0)
|
48
|
+
rspec-support (~> 3.12.0)
|
49
|
+
rspec-expectations (3.12.0)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.12.0)
|
52
|
+
rspec-mocks (3.12.0)
|
53
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
+
rspec-support (~> 3.12.0)
|
55
|
+
rspec-support (3.12.0)
|
56
|
+
teLogger (0.2.2)
|
57
|
+
toolrack (0.19.1)
|
58
|
+
base58
|
59
|
+
tty-color (0.6.0)
|
60
|
+
tty-command (0.10.1)
|
61
|
+
pastel (~> 0.8)
|
62
|
+
tty-cursor (0.7.1)
|
63
|
+
tty-option (0.2.0)
|
64
|
+
tty-prompt (0.23.1)
|
65
|
+
pastel (~> 0.8)
|
66
|
+
tty-reader (~> 0.8)
|
67
|
+
tty-reader (0.9.0)
|
68
|
+
tty-cursor (~> 0.7)
|
69
|
+
tty-screen (~> 0.8)
|
70
|
+
wisper (~> 2.0)
|
71
|
+
tty-screen (0.8.1)
|
72
|
+
wisper (2.0.1)
|
73
|
+
|
74
|
+
PLATFORMS
|
75
|
+
x86_64-linux
|
76
|
+
|
77
|
+
DEPENDENCIES
|
78
|
+
devops_assist
|
79
|
+
dockerun!
|
80
|
+
rake (~> 13.0)
|
81
|
+
rspec (~> 3.0)
|
82
|
+
|
83
|
+
BUNDLED WITH
|
84
|
+
2.2.28
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Dockerun
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dockerun`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'dockerun'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install dockerun
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dockerun.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "dockerun"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/dockerun.gemspec
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/dockerun/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "dockerun"
|
7
|
+
spec.version = Dockerun::VERSION
|
8
|
+
spec.authors = ["Ian"]
|
9
|
+
spec.email = ["cameronian0@protonmail.com"]
|
10
|
+
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.required_ruby_version = ">= 2.4.0"
|
15
|
+
|
16
|
+
#spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
|
+
|
18
|
+
#spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
#spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
20
|
+
#spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_dependency 'toolrack', '~> 0.19.1'
|
34
|
+
spec.add_dependency 'teLogger', '~> 0.2.0'
|
35
|
+
|
36
|
+
spec.add_dependency 'tty-command', "~> 0.10.1"
|
37
|
+
spec.add_dependency 'tty-option', "~> 0.2.0"
|
38
|
+
|
39
|
+
spec.add_dependency 'docker-cli'
|
40
|
+
|
41
|
+
spec.add_development_dependency 'devops_assist'
|
42
|
+
|
43
|
+
# Uncomment to register a new dependency of your gem
|
44
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
45
|
+
|
46
|
+
# For more information and examples about making a new gem, checkout our
|
47
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
48
|
+
end
|
data/exe/dockerun
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'tty/prompt'
|
4
|
+
require_relative '../lib/dockerun'
|
5
|
+
|
6
|
+
if ARGV.length == 0
|
7
|
+
puts "dockerun version #{Dockerun::VERSION}"
|
8
|
+
puts Dockerun::Command::Dockerun.new.help
|
9
|
+
|
10
|
+
else
|
11
|
+
pmt = TTY::Prompt.new
|
12
|
+
|
13
|
+
cmd = Dockerun::Command::Dockerun.new
|
14
|
+
res = cmd.parse(ARGV).params.to_h
|
15
|
+
case res[:command].downcase
|
16
|
+
when "init"
|
17
|
+
initCmd = Dockerun::Command::Init.new
|
18
|
+
argv = ARGV[1..-1]
|
19
|
+
res2 = initCmd.parse(argv).run do |ops, val|
|
20
|
+
case ops
|
21
|
+
when :multiple_templates_detected
|
22
|
+
pmt.select("There are multiple templates available. Please select one of the template : ") do |m|
|
23
|
+
val.each do |v|
|
24
|
+
m.choice v, v
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
STDOUT.puts "\nDockerfile written to '#{res2}'\n\n"
|
31
|
+
|
32
|
+
when "run", "r"
|
33
|
+
|
34
|
+
begin
|
35
|
+
runCmd = Dockerun::Command::Run.new
|
36
|
+
argv = ARGV[1..-1]
|
37
|
+
runCmd.parse(argv).run
|
38
|
+
rescue TTY::Reader::InputInterrupt
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
when "run-new-container", "rnc"
|
43
|
+
|
44
|
+
begin
|
45
|
+
runCmd = Dockerun::Command::RunNewContainer.new
|
46
|
+
argv = ARGV[1..-1]
|
47
|
+
runCmd.parse(argv).run
|
48
|
+
rescue TTY::Reader::InputInterrupt
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
when "run-new-image", "rni"
|
53
|
+
|
54
|
+
begin
|
55
|
+
runCmd = Dockerun::Command::RunNewImage.new
|
56
|
+
argv = ARGV[1..-1]
|
57
|
+
runCmd.parse(argv).run
|
58
|
+
rescue TTY::Reader::InputInterrupt
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
when "rmi", "remove-image"
|
63
|
+
begin
|
64
|
+
riCmd = Dockerun::Command::ResetImage.new
|
65
|
+
argv = ARGV[1..-1]
|
66
|
+
riCmd.parse(argv).run
|
67
|
+
rescue TTY::Reader::InputInterrupt
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
when "remove-container","rmc"
|
72
|
+
# remove container
|
73
|
+
begin
|
74
|
+
riCmd = Dockerun::Command::RemoveContainer.new
|
75
|
+
argv = ARGV[1..-1]
|
76
|
+
riCmd.parse(argv).run
|
77
|
+
rescue TTY::Reader::InputInterrupt
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
else
|
82
|
+
STDERR.puts "Unknown command '#{res[:command]}'"
|
83
|
+
STDOUT.puts cmd.help
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
require 'tty/option'
|
3
|
+
|
4
|
+
module Dockerun
|
5
|
+
module Command
|
6
|
+
|
7
|
+
class Dockerun
|
8
|
+
include TTY::Option
|
9
|
+
|
10
|
+
usage do
|
11
|
+
program "dockerun"
|
12
|
+
no_command
|
13
|
+
end
|
14
|
+
|
15
|
+
argument :command do
|
16
|
+
required
|
17
|
+
desc "Command for the dockerun operations. Supported: init, run (r), run-new-container (rnc), run-new-image (rni), remove-image (rmi), remove-container (rmc)"
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
if params[:help]
|
22
|
+
print help
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
|
2
|
+
require 'tty/option'
|
3
|
+
|
4
|
+
require_relative '../template/template_writter'
|
5
|
+
|
6
|
+
module Dockerun
|
7
|
+
module Command
|
8
|
+
|
9
|
+
class Init
|
10
|
+
include TTY::Option
|
11
|
+
include TR::CondUtils
|
12
|
+
|
13
|
+
class MultipleTemplateDetected < StandardError; end
|
14
|
+
|
15
|
+
usage do
|
16
|
+
program "dockerun"
|
17
|
+
command "init"
|
18
|
+
desc "Initialize a Dockerfile template in given location"
|
19
|
+
end
|
20
|
+
|
21
|
+
argument :location do
|
22
|
+
required
|
23
|
+
desc "Location where the Dockerfile template shall be written"
|
24
|
+
end
|
25
|
+
|
26
|
+
def run(&block)
|
27
|
+
if params[:help]
|
28
|
+
print help
|
29
|
+
exit
|
30
|
+
|
31
|
+
else
|
32
|
+
init_dockerfile(&block)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def init_dockerfile(&block)
|
37
|
+
|
38
|
+
loc = "."
|
39
|
+
loc = params[:location] if not_empty?(params[:location])
|
40
|
+
|
41
|
+
loc = File.expand_path(loc)
|
42
|
+
out = nil
|
43
|
+
if File.directory?(loc)
|
44
|
+
out = File.join(loc, "Dockerfile.dockerun")
|
45
|
+
else
|
46
|
+
out = File.join(File.dirname(loc), "Dockerfile.dockerun")
|
47
|
+
end
|
48
|
+
|
49
|
+
avail = ::Dockerun::Template::TemplateEngine.available_templates
|
50
|
+
selTemp = nil
|
51
|
+
if avail.length > 1
|
52
|
+
if block
|
53
|
+
selTemp = block.call(:multiple_templates_detected, avail)
|
54
|
+
else
|
55
|
+
raise MultipleTemplateDetected, "Multiple template is available but no selected is given."
|
56
|
+
end
|
57
|
+
else
|
58
|
+
selTemp = avail.first
|
59
|
+
end
|
60
|
+
|
61
|
+
tw = ::Dockerun::Template::TemplateWriter.new(selTemp)
|
62
|
+
res = tw.compile
|
63
|
+
|
64
|
+
File.open(out, "w") do |f|
|
65
|
+
f.write res
|
66
|
+
end
|
67
|
+
|
68
|
+
out
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end # class Init
|
73
|
+
|
74
|
+
end # module Command
|
75
|
+
end # module Dockerun
|
@@ -0,0 +1,99 @@
|
|
1
|
+
|
2
|
+
require 'tty/prompt'
|
3
|
+
require 'docker/cli'
|
4
|
+
|
5
|
+
require_relative '../config'
|
6
|
+
require_relative '../docker_command_factory_helper'
|
7
|
+
require_relative '../cli_prompt'
|
8
|
+
|
9
|
+
|
10
|
+
module Dockerun
|
11
|
+
module Command
|
12
|
+
class RemoveContainer
|
13
|
+
include TTY::Option
|
14
|
+
include TR::CondUtils
|
15
|
+
|
16
|
+
include DockerCommandFactoryHelper
|
17
|
+
include CliHelper::CliPrompt
|
18
|
+
|
19
|
+
usage do
|
20
|
+
program "dockerun"
|
21
|
+
command "rmc"
|
22
|
+
desc "Remove container"
|
23
|
+
end
|
24
|
+
|
25
|
+
def run
|
26
|
+
if params[:help]
|
27
|
+
print help
|
28
|
+
exit(0)
|
29
|
+
|
30
|
+
else
|
31
|
+
|
32
|
+
config = ::Dockerun::Config.from_storage
|
33
|
+
|
34
|
+
imageName = nil
|
35
|
+
if is_empty?(config.image_names)
|
36
|
+
raise Error, "No image found"
|
37
|
+
elsif config.image_names.length == 1
|
38
|
+
imageName = config.image_names.first
|
39
|
+
else
|
40
|
+
imageName = cli.select("Please select one of the image below to start : ") do |m|
|
41
|
+
config.image_names.each do |n|
|
42
|
+
m.choice n,n
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
if is_empty?(config.container_names(imageName))
|
48
|
+
STDOUT.puts "There is no container registered under image '#{imageName}'"
|
49
|
+
else
|
50
|
+
|
51
|
+
loop do
|
52
|
+
|
53
|
+
sel = cli.select("Please select the container that would like to be removed : ") do |m|
|
54
|
+
config.container_names(imageName).each do |n|
|
55
|
+
m.choice n,n
|
56
|
+
end
|
57
|
+
|
58
|
+
m.choice "Quit", :quit
|
59
|
+
end
|
60
|
+
|
61
|
+
case sel
|
62
|
+
when :quit
|
63
|
+
break
|
64
|
+
else
|
65
|
+
dcFact.stop_container(sel).run
|
66
|
+
res = dcFact.delete_container(sel).run
|
67
|
+
if res.failed?
|
68
|
+
if res.err_stream =~ /No such container/
|
69
|
+
remove = cli.yes?("It seems the container already deleted. Do you want to remove it from the list?")
|
70
|
+
if remove
|
71
|
+
config.remove_container(imageName, sel)
|
72
|
+
config.to_storage
|
73
|
+
break if is_empty?(config.container_names(imageName))
|
74
|
+
end
|
75
|
+
else
|
76
|
+
STDERR.puts "Failed to delete container '#{sel}'. Error was : #{res.err_stream}"
|
77
|
+
end
|
78
|
+
else
|
79
|
+
|
80
|
+
config.remove_container(imageName, sel)
|
81
|
+
config.to_storage
|
82
|
+
|
83
|
+
break if is_empty?(config.container_names(imageName))
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|