compose-validatr

Crates.iocompose-validatr
lib.rscompose-validatr
version0.1.3
sourcesrc
created_at2023-10-03 22:07:59.404958
updated_at2023-11-18 00:27:22.602851
descriptionLibrary for parsing and validating Docker compose manifests
homepage
repositoryhttps://github.com/dobecad/compose-validatr
max_upload_size
id991603
size79,105
Jace (dobecad)

documentation

README

Unit Tests and Formatting

compose-validatr

Rust library for validating and inspecting docker compose configs

Goals

The main reason this library exists is for another web app project I am working on for visualizing docker-compose configs.

This library is primarily meant for parsing the metadata from a compose yaml and performing surface level validation.

This library performs all validation except host device and local files validation, since that is out of scope of what I need this library for.

Example

// Simple docker-compose.yaml &str
let yaml = r#"
services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    container_name: gitlab
    hostname: gitlab
    restart: always
    build:
      context: .
      dockerfile: webapp.Dockerfile
"#;

let compose = Compose::new(yaml).unwrap();
compose.services.keys().for_each(|service_name| println!("Service: {}", service_name));
Commit count: 82

cargo fmt