Skip to content

Commit

Permalink
docker run privileged
Browse files Browse the repository at this point in the history
  • Loading branch information
Smehnov committed Jan 18, 2024
1 parent 8bfb7d6 commit 8019a5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ pub struct DockerLaunchArgs {
pub network_mode: String,
pub ports: Vec<DockerMap>,
pub volumes: Vec<DockerMap>,
pub env: Vec<String>
pub env: Vec<String>,
pub privileged: bool,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct DockerMap {
Expand Down Expand Up @@ -82,11 +83,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: Some(self.args.env.iter().map(|s| s as &str).collect()),
host_config: Some(bollard::models::HostConfig {
privileged: Some(self.args.privileged),
network_mode: Some(self.args.network_mode.clone()),
binds: Some(volumes),
..Default::default()
Expand Down

0 comments on commit 8019a5b

Please sign in to comment.