mirror of
https://github.com/Xevion/glance.git
synced 2025-12-09 18:07:15 -06:00
Added docker widget with documentation ✨
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
- [Twitch Top Games](#twitch-top-games)
|
||||
- [iframe](#iframe)
|
||||
- [HTML](#html)
|
||||
- [Docker](#docker)
|
||||
|
||||
## Intro
|
||||
Configuration is done via a single YAML file and a server restart is required in order for any changes to take effect. Trying to start the server with an invalid config file will result in an error.
|
||||
@@ -1776,3 +1777,67 @@ Example:
|
||||
```
|
||||
|
||||
Note the use of `|` after `source:`, this allows you to insert a multi-line string.
|
||||
|
||||
### Docker
|
||||
The Docker widget allows you to monitor your Docker containers.
|
||||
To enable this feature, ensure that your setup provides access to the **docker.sock** file.
|
||||
|
||||
Add the following to your `docker-compose` or `docker run` command to enable the Docker widget:
|
||||
|
||||
**Docker Example:**
|
||||
```bash
|
||||
docker run -d -p 8080:8080 \
|
||||
-v ./glance.yml:/app/glance.yml \
|
||||
-v /etc/timezone:/etc/timezone:ro \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
glanceapp/glance
|
||||
```
|
||||
|
||||
**Docker Compose Example:**
|
||||
```yaml
|
||||
services:
|
||||
glance:
|
||||
image: glanceapp/glance
|
||||
volumes:
|
||||
- ./glance.yml:/app/glance.yml
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
ports:
|
||||
- 8080:8080
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
#### Configuration
|
||||
To integrate the Docker widget into your dashboard, include the following snippet in your `glance.yml` file:
|
||||
|
||||
```yaml
|
||||
- type: docker
|
||||
cache: 1m
|
||||
```
|
||||
|
||||
#### Leveraging Container Labels
|
||||
You can use container labels to control visibility, URLs, icons, and titles within the Docker widget. Add the following labels to your container configuration for enhanced customization:
|
||||
|
||||
```yaml
|
||||
labels:
|
||||
- "glance.enable=true" # Enable or disable visibility of the container (default: true)
|
||||
- "glance.title=Glance" # Optional friendly name (defaults to container name)
|
||||
- "glance.url=https://app.example.com" # Optional URL associated with the container
|
||||
- "glance.iconUrl=si:docker" # Optional URL to an image which will be used as the icon for the site
|
||||
|
||||
```
|
||||
|
||||
**Default Values:**
|
||||
|
||||
| Name | Default |
|
||||
|----------------|------------|
|
||||
| glance.enable | true |
|
||||
| glance.title | Container name |
|
||||
| glance.url | (none) |
|
||||
| glance.iconUrl | si:docker |
|
||||
|
||||
Preview:
|
||||
|
||||

|
||||
|
||||
BIN
docs/images/docker-widget-preview.png
Normal file
BIN
docs/images/docker-widget-preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user