Skip to main content

Crate ironflow_ops_docker

Crate ironflow_ops_docker 

Source
Expand description

Docker operations for Ironflow workflows, powered by bollard.

This crate provides Docker operations as Ironflow Operation implementations. Each operation wraps a bollard API call.

§Architecture

  • DockerClient is the central handle, wrapping a bollard::Docker connection
  • Each operation is a standalone struct implementing Operation
  • All operations return kind() == "docker"
  • Parameters are set at construction time via builder methods

§Quick start

use ironflow_ops_docker::DockerClient;
use ironflow_ops_docker::containers::{ContainerCreate, ContainerStart, ContainerRemove};
use ironflow_ops_docker::system::SystemPing;
use ironflow_core::operation::{Operation, OperationContext, NoopSecretResolver};
use std::sync::Arc;

let ctx = OperationContext::new(Arc::new(NoopSecretResolver));
let client = DockerClient::connect_local()?;

// Ping the daemon
let ping = SystemPing::new(&client);
ping.execute(&ctx).await?;

// Create and start a container
let create = ContainerCreate::new(&client, "my-app", "alpine:latest")
    .cmd(vec!["sleep".into(), "3600".into()]);
let output = create.run(&ctx).await?;

let start = ContainerStart::new(&client, &output.id);
start.run(&ctx).await?;

// Cleanup
let remove = ContainerRemove::new(&client, &output.id).force();
remove.run(&ctx).await?;

§Modules

Operations are organized by Docker domain:

ModuleOperations
containersCreate, Start, Stop, Restart, Kill, Remove, Inspect, List, Logs, Exec, Wait, Pause, Unpause, Rename, Top, Stats, Changes, Prune
imagesList, Pull, Push, Inspect, Remove, Tag, History, Search, Prune
volumesCreate, Inspect, List, Remove, Prune
networksCreate, Inspect, List, Remove, Connect, Disconnect, Prune
systemInfo, Version, Ping, Df

Re-exports§

pub use bollard;

Modules§

containers
Container operations.
images
Image operations.
networks
Network operations: create, inspect, list, remove, connect, disconnect, prune.
system
System operations: info, version, ping, df, prune.
volumes
Volume operations: create, inspect, list, remove, prune.

Structs§

DockerClient
A handle to a Docker daemon connection.