feat: add container hashmap
This commit is contained in:
commit
bb1784f259
12 changed files with 1511 additions and 0 deletions
23
src/main.rs
Normal file
23
src/main.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use bollard::Docker;
|
||||
use std::collections::HashMap;
|
||||
use tokio;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> epoch::Result<()> {
|
||||
let docker = Docker::connect_with_local_defaults()?;
|
||||
|
||||
let filters: HashMap<&str, Vec<&str>> = HashMap::from(
|
||||
[
|
||||
("label", vec!["epoch.manage=true"]),
|
||||
],
|
||||
);
|
||||
|
||||
let opts = bollard::query_parameters::ListContainersOptionsBuilder::new()
|
||||
.filters(&filters).build();
|
||||
|
||||
let containers = docker.list_containers(Some(opts)).await?;
|
||||
|
||||
epoch::manager::manage(&containers).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue