Class: Docker::Cli::Operations::RunDel
- Inherits:
-
Object
- Object
- Docker::Cli::Operations::RunDel
- Includes:
- TR::ArgUtils
- Defined in:
- lib/docker/cli/operations/run_del.rb
Instance Method Summary collapse
- #capture_command(a) ⇒ Object
- #capture_image(a) ⇒ Object
-
#initialize ⇒ RunDel
constructor
A new instance of RunDel.
-
#run ⇒ Object
Just run with image name on command line.
- #set_use_same_user(bol) ⇒ Object
Constructor Details
#initialize ⇒ RunDel
Returns a new instance of RunDel.
28 29 30 31 32 33 |
# File 'lib/docker/cli/operations/run_del.rb', line 28 def initialize @match_user = false # leave this blank as the image may have already # set an entry program @cmd = "" end |
Instance Method Details
#capture_command(a) ⇒ Object
40 41 42 |
# File 'lib/docker/cli/operations/run_del.rb', line 40 def capture_command(a) @cmd = a end |
#capture_image(a) ⇒ Object
35 36 37 38 |
# File 'lib/docker/cli/operations/run_del.rb', line 35 def capture_image(a) @dimage = a.first [true, a[1..-1]] end |
#run ⇒ Object
Just run with image name on command line
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/docker/cli/operations/run_del.rb', line 49 def run mountLocal = Dir.getwd mountDocker = "/opt/#{File.basename(Dir.getwd)}" if TR::RTUtils.on_linux? and @match_user # This approach has user match with local user but no name on the docker # workable not nice only Docker::Cli::DockerContainer.create_container(@dimage, interactive: true, tty: true, command: @cmd, mount: { mountLocal => mountDocker }, match_user: @match_user, del: true) else # Apparently on Mac and Windows, the user issue is not an issue Docker::Cli::DockerContainer.create_container(@dimage, interactive: true, tty: true, command: @cmd, mount: { mountLocal => mountDocker }, del: true) end end |
#set_use_same_user(bol) ⇒ Object
44 45 46 |
# File 'lib/docker/cli/operations/run_del.rb', line 44 def set_use_same_user(bol) @match_user = bol end |