Skip to content

Instantly share code, notes, and snippets.

@jneuendorf-i4h
jneuendorf-i4h / docker-compose.sh
Last active October 20, 2023 07:46 — forked from Gems/docker-compose.sh
A `docker-compose` wrapper for multiple configuration files with relative paths
#!/usr/bin/env bash
# A `docker-compose` wrapper for multiple configuration files with relative paths.
# Specifically, build contexts are relative to each compose file's location.
#
# > The way multiple compose file get merged together is now defined by the Compose Specification:
# > https://github.com/compose-spec/compose-spec/blob/master/spec.md#compose-file
# >> Relative paths MUST be resolved based on the first Compose file's parent folder,
# >> whenever complimentary files being merged are hosted in other folders.
# See issue https://github.com/docker/compose/issues/3874#issuecomment-1012923100