Skip to content

Commit

Permalink
docker run with env
Browse files Browse the repository at this point in the history
  • Loading branch information
Smehnov committed Jan 17, 2024
1 parent 171079f commit 8bfb7d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commands/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct DockerLaunchArgs {
pub network_mode: String,
pub ports: Vec<DockerMap>,
pub volumes: Vec<DockerMap>,
pub env: Vec<String>
}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct DockerMap {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 8bfb7d6

Please sign in to comment.