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 99c60ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 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,11 @@ impl DockerLaunch {
volumes.push(format!("{}:{}", volume_pair.key, volume_pair.value))
}



let mut config = bollard::container::Config::<&str> {
image: Some(&self.args.image),
env,
host_config: Some(bollard::models::HostConfig {
network_mode: Some(self.args.network_mode.clone()),
binds: Some(volumes),
Expand Down

0 comments on commit 99c60ea

Please sign in to comment.