docker_compose_config

Functions

docker_compose_config

load("@rules_docker_compose//docker_compose:docker_compose_config.bzl", "docker_compose_config")

docker_compose_config(services, networks, volumes, configs, secrets)

Encode a docker-compose configuration as a JSON string.

Parameters mirror the top-level keys of the Compose Specification. The returned string is suitable for passing to the config attribute of docker_compose_yaml.

PARAMETERS

NameDescriptionDefault Value
servicesA dict mapping service names to their configuration dicts. Each value follows the Compose services.<name> schema (image, ports, environment, volumes, depends_on, etc.).{}
networksA dict mapping network names to their configuration dicts. Follows the Compose networks.<name> schema.{}
volumesA dict mapping volume names to their configuration dicts. Follows the Compose volumes.<name> schema.{}
configsA dict mapping config names to their configuration dicts. Follows the Compose configs.<name> schema.{}
secretsA dict mapping secret names to their configuration dicts. Follows the Compose secrets.<name> schema.{}

RETURNS

A JSON-encoded string representing the docker-compose configuration.