Skip to content

docker containers with multiple hyphens in the name #328

@cord-agencyroot

Description

@cord-agencyroot

Just something I noticed in the latest release (thank you for updating it to support the new docker compose!).

I have a WaitForLogs for a specific message.

 return builder.Wait(serviceName, (service, _) =>
        {
            service.WaitForMessageInLogs(message, timeout);
            return 0;
        });

If my docker container name is like this:

  postgres:
    container_name: some-container-postgres
    environment:
      POSTGRES_USER: postgresql
      POSTGRES_PASSWORD: postgresql
      POSTGRES_DB: postgresql
    image: "postgres:latest"
    ports:
      - "5432:5432"

It doesn't wait for the log.

however, this works just fine. Not sure what's going on exactly, but seems like the extra - in the container name is throwing something off on the wait command.

  postgres:
    container_name: some-postgres
    environment:
      POSTGRES_USER: postgresql
      POSTGRES_PASSWORD: postgresql
      POSTGRES_DB: postgresql
    image: "postgres:latest"
    ports:
      - "5432:5432"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions