Skip to content

Container Names with Underscores #270

@cord-agencyroot

Description

@cord-agencyroot

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions