{"id":22249248,"url":"https://github.com/volker-raschek/dcmerge","last_synced_at":"2025-07-17T02:41:54.186Z","repository":{"id":287930299,"uuid":"906148779","full_name":"volker-raschek/dcmerge","owner":"volker-raschek","description":"[MIRROR]: CI/CD tool to merge multiple docker-compose files","archived":false,"fork":false,"pushed_at":"2025-05-29T11:45:02.000Z","size":174,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T12:45:52.519Z","etag":null,"topics":["container","dcmerge","docker","docker-compose"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/volkerraschek/dcmerge","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volker-raschek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-20T09:11:47.000Z","updated_at":"2025-05-29T11:45:06.000Z","dependencies_parsed_at":"2025-05-22T08:59:47.517Z","dependency_job_id":"406b6600-2497-4d7d-ac32-936bf75608ad","html_url":"https://github.com/volker-raschek/dcmerge","commit_stats":null,"previous_names":["volker-raschek/dcmerge"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/volker-raschek/dcmerge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volker-raschek%2Fdcmerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volker-raschek%2Fdcmerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volker-raschek%2Fdcmerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volker-raschek%2Fdcmerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volker-raschek","download_url":"https://codeload.github.com/volker-raschek/dcmerge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volker-raschek%2Fdcmerge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265560956,"owners_count":23788285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","dcmerge","docker","docker-compose"],"created_at":"2024-12-03T06:25:42.235Z","updated_at":"2025-07-17T02:41:54.173Z","avatar_url":"https://github.com/volker-raschek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dcmerge\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/dcmerge)](https://hub.docker.com/r/volkerraschek/dcmerge)\n\n`dcmerge` is a small program to merge docker-compose files from multiple sources. It is available via RPM and docker.\n\nThe dynamic pattern of a docker-compose file, that for example `environments` can be specified as a string slice or a\nlist of objects is currently not supported. `dcmerge` expect a strict pattern layout. The `environments`, `ports` and\n`volumes` must be declared as a slice of strings.\n\nDockercompose file can be read-in from different sources. Currently are the following sources supported:\n\n- File\n- HTTP/HTTPS\n\nFurthermore, `dcmerge` support different ways to merge multiple docker-compose files.\n\n- The default merge, add missing secrets, services, networks and volumes.\n- The existing-win merge, add and protect existing attributes.\n- The last-win merge, add or overwrite existing attributes.\n\n## default\n\nMerge only missing secrets, services, networks and volumes **without respecting their attributes**. For example, when\nthe service `app` is already declared, it is not possible to add the service `app` twice. The second service will be\ncompletely skipped.\n\n```yaml\n---\n# cat ~/docker-compose-A.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=HelloWorld123\n    image: example.local/app/name:0.1.0\n---\n# cat ~/docker-compose-B.yaml\nservices:\n  app:\n    image: app/name:2.3.0\n    volume:\n    - /etc/localtime:/etc/localtime\n    - /dev/urandom:/etc/urandom\n  db:\n    image: postgres\n    volume:\n    - /etc/localtime:/etc/localtime\n    - /dev/urandom:/etc/urandom\n---\n# dcmerge ~/docker-compose-A.yaml ~/docker-compose-B.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=HelloWorld123\n    image: example.local/app/name:0.1.0\n  db:\n    image: postgres\n    volume:\n    - /etc/localtime:/etc/localtime\n    - /dev/urandom:/etc/urandom\n```\n\n## existing-win\n\nThe existing-win merge protects existing attributes. For example there are two different docker-compose files, but booth\nhas the same environment variable `CLIENT_SECRET` defined with different values. The first declaration of the attribute\nwins and is for overwriting protected.\n\n```yaml\n---\n# cat ~/docker-compose-A.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=HelloWorld123\n    image: example.local/app/name:0.1.0\n---\n# cat ~/docker-compose-B.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=FooBar123\n    image: example.local/app/name:0.1.0\n---\n# dcmerge --existing-win ~/docker-compose-A.yaml ~/docker-compose-B.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=HelloWorld123\n    image: example.local/app/name:0.1.0\n```\n\n## last-win\n\nThe last-win merge overwrite recursive existing attributes. For example there are two different docker-compose files,\nbut booth has the same environment variable `CLIENT_SECRET` defined with different values. The last passed\ndocker-compose file which contains this environment wins.\n\n```yaml\n---\n# cat ~/docker-compose-A.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=HelloWorld123\n    image: example.local/app/name:0.1.0\n---\n# cat ~/docker-compose-B.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=FooBar123\n    image: example.local/app/name:0.1.0\n---\n# dcmerge --last-win ~/docker-compose-A.yaml ~/docker-compose-B.yaml\nservices:\n  app:\n    environments:\n    - CLIENT_SECRET=FooBar123\n    image: example.local/app/name:0.1.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolker-raschek%2Fdcmerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolker-raschek%2Fdcmerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolker-raschek%2Fdcmerge/lists"}