dockworker icon indicating copy to clipboard operation
dockworker copied to clipboard

SSH support

Open IamTheCarl opened this issue 4 years ago • 3 comments

I have some shell scripts that control docker on a remote system using an ssh connection to that machine. I'd like to upgrade those shell scripts to Rust.

I understand that making ssh2 a required dependency of this project can be cumbersome since most people aren't using this feature. Could permitting the library to communicate over a generic reader/writer work? That's something I'd be willing to work with.

IamTheCarl avatar May 13 '21 15:05 IamTheCarl

Are you planning to add the following parameters?

impl Docker {
  //  `R` and `W` may be wrapped into ssh tunnel
  fn new_from_reader_writer<R:Reader, W:Writer>(r:R, w:W, protocol: Protocol) ->Docker { .. }
}

eldesh avatar May 20 '21 07:05 eldesh

Yes. This exactly what I have in mind. That'll let you use this over any reliable stream.

IamTheCarl avatar May 21 '21 23:05 IamTheCarl

If implemented as above, the reader/writer would need to be wrapped in HyperClient. Then, the following form may be more preferable.

// pseudo code
let http: HyperClient = HyperClient::with_rw(rd, wr)?;
let docker = Docker::new(http, Unix)?

eldesh avatar May 25 '21 08:05 eldesh