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

Container Names with Underscores #270

Open
cord-agencyroot opened this issue Aug 9, 2022 · 1 comment
Open

Container Names with Underscores #270

cord-agencyroot opened this issue Aug 9, 2022 · 1 comment
Assignees
Milestone

Comments

@cord-agencyroot
Copy link

cord-agencyroot commented Aug 9, 2022

Not sure if this is actually said anywhere, but I was having a terrible time trying to get the wait to properly work with docker-compose.

None of the 'wait' lambda breakpoints where being hit, here is an example:

  compositeBuilder.Wait("postgres_projectname", (service, _) =>
        {
            service.WaitForMessageInLogs("listening on IPv4 address", 30000L);
            return 0;
        });

Placing a breakpoint inside the lambda would never stop at the "WaitForMessageInLogs" line.

  postgres_projectname:
    container_name: postgres_projectname
    environment:
      POSTGRES_USER: postgressql
      POSTGRES_PASSWORD: postgressql
      POSTGRES_DB: postgressql
    image: postgres:14-alpine
    ports:
      - "5432:5432"

Turns out it was because I had _ (underscore) character for my container names, seems like it causes FluentDocker to ignore the wait (or doesn't find a match) when building.

Change my container name to 'postgres-projectname' seemed to fix the issue

Not sure if this is a bug or working as intended, but it would be nice to get some sort of notification/warning with using _ as a name. Hopefully this helps someone if they come across the same issue.

Note: This may be more of a docker limitation than an issue with FluentDocker, but hopefully this helps someone

@mariotoffia mariotoffia self-assigned this Aug 22, 2022
@mariotoffia mariotoffia added this to To do in FluentDocker via automation Aug 22, 2022
@mariotoffia mariotoffia added this to the 3.0.0-RELEASE milestone Aug 22, 2022
@mariotoffia
Copy link
Owner

Hi @cord-agencyroot, thanks for the bug report and the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
FluentDocker
  
To do
Development

No branches or pull requests

2 participants