Class: Dip::Commands::SSH::Up
- Inherits:
-
Dip::Command
- Object
- Dip::Command
- Dip::Commands::SSH::Up
- Defined in:
- lib/dip/commands/ssh.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(key:, volume:, interactive:, user: nil) ⇒ Up
constructor
A new instance of Up.
Methods inherited from Dip::Command
Constructor Details
#initialize(key:, volume:, interactive:, user: nil) ⇒ Up
Returns a new instance of Up.
10 11 12 13 14 15 |
# File 'lib/dip/commands/ssh.rb', line 10 def initialize(key:, volume:, interactive:, user: nil) @key = key @volume = volume @interactive = interactive @user = user end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dip/commands/ssh.rb', line 17 def execute exec_subprocess("docker", "volume create --name ssh_data", out: File::NULL, err: File::NULL) exec_subprocess( "docker", "run #{user_args}--detach --volume ssh_data:/ssh --name=ssh-agent whilp/ssh-agent" ) key = Dip.env.interpolate(@key) exec_subprocess("docker", "run #{container_args} whilp/ssh-agent ssh-add #{key}") end |