A library for writing Docker Compose files in Dhall.
Note: Only version 3.0 of the Docker Compose config is supported currently.
If you wish to add another version it is probably worth spending the time to write a json-spec to dhall converter. See dhall-kubernetes' generator.
To experiment with Dhall for config.
-- for the imports in your docker-compose.dhall file you should either download
-- the dhall files or use the URL imports.
let types = ./compose/v3/types.dhall
let defaults = ./compose/v3/defaults.dhall
in defaults.ComposeConfig // {
-- your config here
} : types.ComposeConfig
-
brew install dhall-json
-
generate yaml
dhall-to-yaml < "example/docker-compose-deploy.dhall" --explain --omitNull > ./example/docker-compose-deploy.yml
Note that the yaml keys are alphabetized in the generated yaml.