self.delete_instance

in lib/res_cli/cli.rb [258:283]


    def self.delete_instance(instance_id)
        begin
            
            puts "Deleting instance #{instance_id}..."
        
            
            _, stop_status = Open3.capture2("docker stop #{instance_id}")
        
            unless stop_status.success?
              raise "Error stopping instance: #{stop_status}"
            end
        
            
            _, rm_status = Open3.capture2("docker rm #{instance_id}")
        
            unless rm_status.success?
              raise "Error removing instance: #{rm_status}"
            end
        
            puts "Instance deleted successfully."
        
          rescue => error
            $stderr.puts "Error deleting instance: #{error}"
          end
    end