glance icon indicating copy to clipboard operation
glance copied to clipboard

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

Open mike391 opened this issue 8 months ago • 3 comments

To address this feature: https://github.com/glanceapp/glance/issues/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.

mike391 avatar Mar 17 '25 11:03 mike391

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 avatar Mar 18 '25 10:03 svilenmarkov

@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 avatar Mar 19 '25 13:03 mike391

i like arrays more

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

uykukacinca avatar Mar 24 '25 23:03 uykukacinca