Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass multiple compose files like -f <file> -f <other file>? #281

Open
ci-vamp opened this issue Nov 16, 2022 · 1 comment
Open

How to pass multiple compose files like -f <file> -f <other file>? #281

ci-vamp opened this issue Nov 16, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@ci-vamp
Copy link

ci-vamp commented Nov 16, 2022

here is what i am trying to accomplish

docker-compose --project-directory ./docker -f docker-compose.yml -f docker-compose.prod.yml up

got the following exception

Unhandled exception. Ductus.FluentDocker.Common.FluentDockerException: Could not dispose composite service from file(s) docker-compose.yml, docker-compose.prod.yml

attempt with fluent docker

using Ductus.FluentDocker.Services;
using Ductus.FluentDocker.Services.Impl;
using Ductus.FluentDocker.Model.Compose;

var hosts = new Hosts().Discover();
var _docker = hosts.FirstOrDefault(host => host.IsNative) ?? hosts.FirstOrDefault(host => host.Name == "default");

var composeConfig = new DockerComposeConfig
{
    ProjectDirectory = Path.Combine(Directory.GetCurrentDirectory(), "docker"),
    ComposeFilePath = new List<string> { "docker-compose.yml", "docker-compose.prod.yml" },
    ForceRecreate = true,
    RemoveOrphans = true,
    StopOnDispose = true,
};


using (var serviceManager = new DockerComposeCompositeService(_docker, composeConfig))
{
    foreach (var container in serviceManager.Containers)
    {
        Console.WriteLine(container.Name);
    }
}
@mariotoffia mariotoffia self-assigned this Nov 28, 2022
@mariotoffia mariotoffia added this to the 3.0.0-RELEASE milestone Nov 28, 2022
@mariotoffia
Copy link
Owner

Thanks @ms-vamp for your bug report! I'll add it to my long todo list - but this one should be fairly simple to fix.

Cheers,
Mario :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants