fussybeaver / bollard

Docker daemon API in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems Connecting w/ HTTP

bpmooch opened this issue · comments

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.

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