chore: composer: workaround fussybeaver/bollard#166
@@ -30,6 +30,7 @@ use bollard::{
PortMap,
},
Docker,
+ API_DEFAULT_VERSION,
};
use futures::{StreamExt, TryStreamExt};
use ipnetwork::Ipv4Network;
@@ -558,7 +559,16 @@ impl Builder {
let path = std::path::PathBuf::from(std::env!("CARGO_MANIFEST_DIR"));
let srcdir = path.parent().unwrap().to_string_lossy().into();
- let docker = Docker::connect_with_unix_defaults()?;
+ // FIXME: We can just use `connect_with_unix_defaults` once this is
+ // resolved and released:
+ //
+ // https://github.com/fussybeaver/bollard/issues/166
+ let docker = match std::env::var("DOCKER_HOST") {
+ Ok(host) => {
+ Docker::connect_with_unix(&host, 120, API_DEFAULT_VERSION)
+ }
+ Err(_) => Docker::connect_with_unix_defaults(),
+ }?;
let mut cfg = HashMap::new();
cfg.insert(
