#compose #yml #yaml #serialization #parse #api #service

compose_yml

Parse, manipulate and serialize docker-compose.yml in a strongly-typed fashion

20 releases

0.0.59 Sep 13, 2020
0.0.58 Jul 5, 2020
0.0.57 Apr 8, 2020
0.0.55 Jan 12, 2019
0.0.48 Nov 13, 2016

#727 in Development tools

Download history 55/week @ 2022-11-27 46/week @ 2022-12-04 39/week @ 2022-12-11 125/week @ 2022-12-18 7/week @ 2022-12-25 21/week @ 2023-01-01 86/week @ 2023-01-08 185/week @ 2023-01-15 14/week @ 2023-01-22 25/week @ 2023-01-29 44/week @ 2023-02-05 90/week @ 2023-02-12 127/week @ 2023-02-19 4/week @ 2023-02-26 12/week @ 2023-03-05 5/week @ 2023-03-12

149 downloads per month
Used in 2 crates

CC0-1.0 AND Apache-2.0

170KB
3.5K SLoC

compose_yml: Support for working with docker-compose.yml files

Latest version License Build Status Build status Documentation Gitter

This is a work in progress! Most of services: is supported, but I'm still refining the APIs as higher-level tools get build around this.

Goals

docker-compose.yml is a very useful format, but it's hard to parse and transform correctly. This library aims to offer:

  • High-level, type-safe APIs for anything you can find in a docker-compose.yml file.
  • Parsing of individual string fields into real objects.
  • Support for working with strings that might contain variable interpolations, and leaving them unparsed when necessary.
  • Canonical representations of fields which may have multiple formats.
  • Easy updates when docker-compose.yml gets extended.

Building

You can build this library using stable Rust version 1.11. But if you want to develop it, you will get much better error messages using a nightly build of Rust.

# Install Rust stable and nightly using rustup.
curl -sSf https://static.rust-lang.org/rustup.sh | sh
rustup toolchain install nightly

# Build unit tests using nightly Rust.
rustup run nightly cargo test --no-default-features --features unstable

License

This library is in the public domain as described by LICENSE.txt, except for the files src/v2/validate/config_schema_v2.*.json, which are copyright Docker, Inc., and distributed under the Apache License, version 2.0.

Sponsor

Part of the work on compose_yml has been generously sponsored by Faraday for use in their cage tool, which is designed to go beyond docker-compose and provide support for large, multi-pod apps.

Dependencies

~10MB
~291K SLoC