diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/builder.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/builder.rs b/src/builder.rs index 1f6fc38..110abcc 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -8,6 +8,7 @@ use std::{ collections::{BTreeMap, HashMap}, hash::Hash, iter::{IntoIterator, Peekable}, + time::Duration, }; use url::form_urlencoded; @@ -931,6 +932,33 @@ impl ContainerOptionsBuilder { self } + /// Signal to stop a container as a string. Default is "SIGTERM". + pub fn stop_signal( + &mut self, + sig: &str, + ) -> &mut Self { + self.params.insert("StopSignal", json!(sig)); + self + } + + /// Signal to stop a container as an integer. Default is 15 (SIGTERM). + pub fn stop_signal_num( + &mut self, + sig: u64, + ) -> &mut Self { + self.params.insert("StopSignal", json!(sig)); + self + } + + /// Timeout to stop a container. Only seconds are counted. Default is 10s + pub fn stop_timeout( + &mut self, + timeout: Duration, + ) -> &mut Self { + self.params.insert("StopTimeout", json!(timeout.as_secs())); + self + } + pub fn userns_mode( &mut self, mode: &str, |