mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-07-18 16:21:24 +00:00
Allow to override any config option via environment variables using SECTION_KEY_NAME syntax
This commit is contained in:
parent
b49076db7c
commit
f7e40bece8
@ -3,6 +3,8 @@
|
|||||||
## UNRELEASED
|
## UNRELEASED
|
||||||
|
|
||||||
* Fix repo tag count when a repo name is a prefix for another repo name(s)
|
* Fix repo tag count when a repo name is a prefix for another repo name(s)
|
||||||
|
* Allow to override any config option via environment variables using SECTION_KEY_NAME syntax, e.g.
|
||||||
|
LISTEN_ADDR, PERFORMANCE_TAGS_COUNT_REFRESH_INTERVAL, REGISTRY_HOSTNAME etc.
|
||||||
|
|
||||||
## 0.10.1 (2024-04-19)
|
## 0.10.1 (2024-04-19)
|
||||||
|
|
||||||
|
@ -27,6 +27,9 @@ Docker images [quiq/registry-ui](https://hub.docker.com/r/quiq/registry-ui/tags/
|
|||||||
|
|
||||||
The configuration is stored in `config.yml` and the options are self-descriptive.
|
The configuration is stored in `config.yml` and the options are self-descriptive.
|
||||||
|
|
||||||
|
You can override any config option via environment variables using SECTION_KEY_NAME syntax,
|
||||||
|
e.g. `LISTEN_ADDR`, `PERFORMANCE_TAGS_COUNT_REFRESH_INTERVAL`, `REGISTRY_HOSTNAME` etc.
|
||||||
|
|
||||||
### Run UI
|
### Run UI
|
||||||
|
|
||||||
docker run -d -p 8000:8000 -v /local/config.yml:/opt/config.yml:ro quiq/registry-ui
|
docker run -d -p 8000:8000 -v /local/config.yml:/opt/config.yml:ro quiq/registry-ui
|
||||||
|
2
main.go
2
main.go
@ -51,6 +51,8 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("fatal error reading config file: %w", err))
|
panic(fmt.Errorf("fatal error reading config file: %w", err))
|
||||||
}
|
}
|
||||||
|
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||||
|
viper.AutomaticEnv()
|
||||||
|
|
||||||
// Init registry API client.
|
// Init registry API client.
|
||||||
a.client = registry.NewClient()
|
a.client = registry.NewClient()
|
||||||
|
Loading…
Reference in New Issue
Block a user