Skip to main content

Crate use_docker

Crate use_docker 

Source
Expand description

§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");
}

§Status

Experimental while the workspace remains below 0.3.0. Thin facade for primitive Docker vocabulary crates.

Re-exports§

pub use use_docker_build as build;
pub use use_docker_compose as compose;
pub use use_docker_env as env;
pub use use_docker_healthcheck as healthcheck;
pub use use_docker_image as image;
pub use use_docker_label as label;
pub use use_docker_network as network;
pub use use_docker_port as port;
pub use use_docker_registry as registry;
pub use use_docker_tag as tag;
pub use use_docker_volume as volume;
pub use use_dockerfile as dockerfile;
pub use use_dockerignore as dockerignore;

Modules§

prelude
Common Docker primitive re-exports.