Skip to content

Feat: Added support for configuring Docker containers through glance.yaml instead of labels #453

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

Conversation

mike391
Copy link

@mike391 mike391 commented Mar 17, 2025

To address this feature:
#452

Before:
oldview

After:
newview

Sample glance.yml used during testing:

pages:
  - name: Startpage
    width: slim
    hide-desktop-navigation: true
    center-vertically: true
    columns:
      - size: full
        widgets:
          - type: search
            autofocus: true

          - type: docker-containers
            hide-by-default: false
            readable-names: true
            containers:
              glance:  # This is the actual container name
                title: "Test Glances Name"
                description: "test-description"
                url: "127.0.0.1:3011/test"
                icon: "si:jellyfin"
                hide: false

Where an existing docker container with the name glance is running.

@svilenmarkov
Copy link
Member

Hey, thanks for contributing!

This is something I want to add support for, however before doing that I think we need to have a discussion around how it would work in conjunction with this feature, since that does mean that you may end up with multiple containers having the same name.

@svilenmarkov svilenmarkov added the feedback wanted Requires feedback from the community label Mar 18, 2025
@svilenmarkov svilenmarkov changed the title Add support configure docker containers yaml Add support for configuring Docker containers through glance.yaml instead of labels Mar 18, 2025
@mike391
Copy link
Author

mike391 commented Mar 19, 2025

@svilenmarkov I think one way we can support this with the feature you linked is to extend it by adding an optional name property to the config:

- type: docker-containers
  providers:
    - name: glance-socket
    - type: proxy
      host: tcp://glance-socket-proxy:2375
    - type: proxy
      host: tcp://some-other-server:2375

Then we can specify the provider here if needed:

          containers:
              glance:  # This is the actual container name
                provider: glance-socket
                title: "Test Glances Name"
                description: "test-description"
                url: "127.0.0.1:3011/test"
                icon: "si:jellyfin"
                hide: false

If a provider or name aren't included the rename mapping will just happen for every container that matches the name in the overrides.

Or we can even extend the name to just have the provider name included as part of the human readable option. E.g. using the above config:
Glance [glance-socket]

How does that sound?

@mike391 mike391 changed the title Add support for configuring Docker containers through glance.yaml instead of labels Feat: Added support for configuring Docker containers through glance.yaml instead of labels Mar 22, 2025
@uykukacinca
Copy link

i like arrays more

containers:
  - name: glance # This is the actual container name
    provider: glance-socket
    title: "Test Glances Name"
    ...

Copy link
Member

@svilenmarkov svilenmarkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm dropping the plan to add merging container data from multiple sources for now, as it makes things much more complicated and confusing. I've tweaked the implementation a bunch to simply merge the labels upon fetching, which removes the need to do multiple checks later on. Thanks again for contributing!

@svilenmarkov svilenmarkov merged commit 1862858 into glanceapp:dev Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback wanted Requires feedback from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants