Skip to content

Commit

Permalink
✨ Allow users to specifiy volume binds for docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
TilBlechschmidt committed Dec 6, 2021
1 parent 44c12c8 commit 00e3037
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/modules/src/orchestrator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl Orchestrator {
provisioner_options.images.clone(),
!provisioner_options.retain_exited_sessions,
provisioner_options.storage,
provisioner_options.volume,
provisioner_options.log,
)
.unwrap();
Expand Down
5 changes: 5 additions & 0 deletions core/modules/src/orchestrator/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ pub struct DockerOptions {
value_name = "sessionLevel"
)]
pub log: String,

/// Volume binds for session containers using the docker format (e.g. /tmp/onHost:/insideContainer).
/// Using this option is not recommended and it will be deprecated at a later point.
#[structopt(env, long)]
pub volume: Vec<String>,
}

#[derive(Debug, StructOpt)]
Expand Down
4 changes: 4 additions & 0 deletions core/modules/src/orchestrator/provisioner/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct DockerProvisioner {
instance: Uuid,
auto_remove: bool,
storage: Option<String>,
binds: Vec<String>,
log: String,
}

Expand All @@ -53,6 +54,7 @@ impl DockerProvisioner {
images: ContainerImageSet,
auto_remove: bool,
storage: Option<String>,
binds: Vec<String>,
log: String,
) -> Result<Self, bollard::errors::Error> {
if images.is_empty() {
Expand All @@ -68,6 +70,7 @@ impl DockerProvisioner {
instance,
auto_remove,
storage,
binds,
log,
})
}
Expand Down Expand Up @@ -136,6 +139,7 @@ impl DockerProvisioner {
auto_remove: Some(self.auto_remove),
network_mode: Some("webgrid".to_string()),
shm_size: Some(1024 * 1024 * 1024 * 2),
binds: Some(self.binds.clone()),
..Default::default()
};

Expand Down

0 comments on commit 00e3037

Please sign in to comment.