Skip to content

Conversation

@karthik-kotra
Copy link

This PR adds container name visibility in the Services window.
Previously, LazyDocker displayed only the service name (from docker-compose.yml) but did not show the container’s actual container_name value.
This caused confusion when multiple services used custom container names.

Problem
Given a docker-compose.yml like:

services:

  mongodb:
    image: mongo
    container_name: "db_app"
  frontend:
    image: quizgame/webclient
    container_name: "web_app"

LazyDocker would display:

running frontend 0.00%
running mongodb 0.35%

But the expected behavior is:

running frontend (web_app) 0.00%
running mongodb (db_app) 0.35%

Users want to see both the service name and the actual container name.

Fix Implemented

Updated the UI rendering logic in the Services window.

Added container name retrieval and appended it in parentheses next to each service.

Ensures format:
service_name (container_name)

Works for all containers, including those without a custom container_name (fallback gracefully handled).

Result
Services now correctly display:

running frontend (web_app)
running mongodb (db_app)

Closes: #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: show container names

1 participant