feat: add container hashmap

This commit is contained in:
Alexander Navarro 2025-06-25 16:14:35 -04:00
commit bb1784f259
12 changed files with 1511 additions and 0 deletions

23
src/main.rs Normal file
View 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(())
}