Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myitcv/docker-compose
docker-compose is a wrapper that composes COMPOSE_FILE and -f flags with config-local resolution
https://github.com/myitcv/docker-compose
Last synced: 3 months ago
JSON representation
docker-compose is a wrapper that composes COMPOSE_FILE and -f flags with config-local resolution
- Host: GitHub
- URL: https://github.com/myitcv/docker-compose
- Owner: myitcv
- Created: 2020-06-19T04:37:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-09-23T16:20:11.000Z (over 4 years ago)
- Last Synced: 2024-10-25T17:16:09.016Z (3 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## `docker-compose`
The `docker-compose` command is a wrapper around the real [`docker-compose`](https://github.com/docker/compose) that
provides compose-file relative resolution and composition of the `COMPOSE_FILE` environment variable and `-f` flag
values.Specifically this is a solution for issues [docker/compose#3874](https://github.com/docker/compose/issues/3874) and
[docker/compose#7546](https://github.com/docker/compose/issues/7546).### Installation
Requires a working [Go installation](https://golang.org/dl/):
```
(cd $(mktemp -d) && go mod init mod && go get github.com/myitcv/docker-compose)
```### Example
Setting the `COMPOSE_FILE` allows you to compose `docker-compose` files from different projects:
```
export COMPOSE_FILE=/path/to/project1/docker-compose.yml:/path/to/project2/docker-compose.yml
docker-compose up -d
```The result is the "merge" of the `n` input files.
You can specify additional config files either by augmenting the `COMPOSE_FILE` environment variable, or by supplying
`-f` flag values. Assuming the value of `COMPOSE_FILE` from above:```
docker-compose -f prod.yml config
```would be the result of composing `/path/to/project1/docker-compose.yml`,
`/path/to/project2/docker-compose.yml` and `prod.yml`.Resolution of a config file happens relative to its containing directory. For example,
`/path/to/project1/docker-compose.yml` would be resolved relative to `/path/to/project1`.