podman 0.1.0
podman: ^0.1.0 copied to clipboard
A Dart client for the Podman libpod API over Unix sockets.
podman #
A Dart client for the Podman libpod API over the Podman socket.
This package uses HTTP over Unix sockets and targets libpod endpoints directly,
without shelling out to the podman CLI.
Features #
- Typed
PodmanClientAPI for system, container, and image operations - Network lifecycle and connect/disconnect APIs
- Network exists/update/prune APIs
- Volume lifecycle APIs
- Pod lifecycle APIs
- Pod exists/admin/top/stats/prune APIs
- Container runtime helpers (
wait,healthStatus,exec,stats) - Container admin APIs (kill/pause/unpause/top/init/rename/update/mount/archive)
- Container checkpoint/restore APIs (including archive export/import helpers)
- System maintenance APIs (
system/df,system/check,system/prune) - Typed events API with reconnecting watch stream
- Unix-socket transport (
UnixSocketPodmanTransport) - Libpod API-first implementation (no Docker-compat fallback path)
- Focused option and model types
- Testable transport abstraction for deterministic unit tests
Installation #
dart pub add podman
Quick Start #
import 'package:podman/podman.dart';
Future<void> main() async {
final client = PodmanClient();
final version = await client.version();
print('Podman server: ${version.serverVersion}');
await client.close();
}
Socket Resolution #
By default, the transport resolves socket path in this order:
PODMAN_SOCKET$XDG_RUNTIME_DIR/podman/podman.sock/run/user/$UID/podman/podman.sock/run/podman/podman.sock
You can override via:
final client = PodmanClient(socketPath: '/custom/path/podman.sock');
Examples #
example/version_info_example.dartexample/list_containers_example.dartexample/pull_and_run_example.dartexample/inspect_container_example.dartexample/secrets_workflow_example.dartexample/manifest_workflow_example.dartexample/artifact_workflow_example.dartexample/generate_assets_example.dartexample/play_kube_file_example.dartexample/system_maintenance_example.dartexample/checkpoint_restore_example.dart
Copy/paste command guide:
doc/examples.md
Testing Backends #
Default tests use a fake transport for deterministic unit coverage:
melos run test
Local integration tests can run against your local Podman socket:
melos run test:integration
Optional env vars:
PODMAN_TEST_SOCKET: override socket path for local testsPODMAN_LOCAL_TESTS=1: alternate way to enable local tests