use-docker 0.0.1

Feature-gated facade crate for RustUse Docker primitives
Documentation

use-docker

Feature-gated facade crate for RustUse Docker primitives.

use-docker re-exports focused crates for Dockerfile instruction fragments, .dockerignore rules, image references, tags, registries, Compose-shaped data, ports, volumes, networks, env files, healthchecks, labels, and build metadata. It is not a Docker engine, client, registry client, Compose implementation, or command runner.

Basic Usage

#[cfg(feature = "full")]
{
use use_docker::{dockerfile, image, port};

let reference: image::DockerImageReference = "ghcr.io/rustuse/app:latest".parse()?;
let mapping: port::PortMapping = "8080:80".parse()?;
let instruction = dockerfile::DockerfileInstruction::run("cargo test");

assert_eq!(reference.repository(), "app");
assert_eq!(mapping.container_port().get(), 80);
assert_eq!(instruction.to_string(), "RUN cargo test");
}
# Ok::<(), Box<dyn std::error::Error>>(())

Status

Experimental while the workspace remains below 0.3.0.