From 8bfb7d6f11c8c0b1f2ad38a3edc9960743fc29c3 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 17 Jan 2024 17:58:06 +0300 Subject: [PATCH] docker run with env --- src/commands/docker.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/docker.rs b/src/commands/docker.rs index dec68e3..828d18c 100644 --- a/src/commands/docker.rs +++ b/src/commands/docker.rs @@ -43,6 +43,7 @@ pub struct DockerLaunchArgs { pub network_mode: String, pub ports: Vec, pub volumes: Vec, + pub env: Vec } #[derive(Clone, Serialize, Deserialize, Debug)] pub struct DockerMap { @@ -81,8 +82,10 @@ impl DockerLaunch { volumes.push(format!("{}:{}", volume_pair.key, volume_pair.value)) } + let mut config = bollard::container::Config::<&str> { image: Some(&self.args.image), + env: Some(self.args.env.iter().map(|s| s as &str).collect()), host_config: Some(bollard::models::HostConfig { network_mode: Some(self.args.network_mode.clone()), binds: Some(volumes),