fussybeaver / bollard

Docker daemon API in Rust
Apache License 2.0
893 stars 134 forks source link

Problems Connecting w/ HTTP #375

Closed bpmooch closed 7 months ago

bpmooch commented 7 months ago
let docker = Docker::connect_with_http(&hostname, 4, API_DEFAULT_VERSION)
    .expect("failed to initialize docker connection");
let something = rt.block_on(docker.ping()).expect("failed to ping dockerd");
println!("ping result: {}", something);

hostname is set to 192.168.122.253:2375, which I've validated works using docker -H=192.168.122.253:2375 version. The rust code, however, returns this error message:

thread '<unnamed>' panicked at 'failed to ping dockerd: JsonSerdeError { err: Error("expected value", line: 1, column: 1) }', src/lib.rs:41:48

How can I debug what the issue is here? Worth pointing out I've tested this code with Docker::connect_with_local_defaults() and it works.

bpmooch commented 7 months ago

user error, sorry! Forgot I had enabled tls on dockerd for the test