mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
GHA/docs: Containerized Setup
Add a new section to the documentation about installing in containerized environments. Also, add a GitHub Action that pushes this new section to Docker Hub to display it as the container README.
This commit is contained in:
parent
3a3ec2c081
commit
02a0bb94bc
2 changed files with 106 additions and 0 deletions
21
.github/workflows/sync-for-container.yml
vendored
Normal file
21
.github/workflows/sync-for-container.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: Sync For-Container.md to Docker Hub
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout HEAD
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Sync For-Container.md
|
||||
uses: ms-jpq/sync-dockerhub-readme@df5121ab3314dc86fd36863eb111ab986fc6c612
|
||||
|
||||
with:
|
||||
username: icingaadmin
|
||||
password: '${{ secrets.DOCKER_HUB_PERSONAL_TOKEN }}'
|
||||
repository: icinga/icingadb
|
||||
readme: ./doc/02-Installation.md.d/For-Container.md
|
||||
85
doc/02-Installation.md.d/For-Container.md
Normal file
85
doc/02-Installation.md.d/For-Container.md
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
# Installing Icinga DB in Containers
|
||||
|
||||
This image integrates Icinga DB into your containerized environment.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
docker network create icinga
|
||||
|
||||
docker run --rm -d \
|
||||
--network icinga \
|
||||
--name redis-icingadb \
|
||||
redis
|
||||
|
||||
docker run -d \
|
||||
--network icinga \
|
||||
--name mariadb-icingadb \
|
||||
-e MYSQL_RANDOM_ROOT_PASSWORD=1 \
|
||||
-e MYSQL_DATABASE=icingadb \
|
||||
-e MYSQL_USER=icingadb \
|
||||
-e MYSQL_PASSWORD=123456 \
|
||||
mariadb
|
||||
|
||||
docker run -d \
|
||||
--network icinga \
|
||||
--restart always \
|
||||
--name icingadb \
|
||||
-e ICINGADB_REDIS_HOST=redis-icingadb \
|
||||
-e ICINGADB_REDIS_PORT=6379 \
|
||||
-e ICINGADB_REDIS_PASSWORD=123456 \
|
||||
-e ICINGADB_DATABASE_HOST=mariadb-icingadb \
|
||||
-e ICINGADB_DATABASE_PORT=3306 \
|
||||
-e ICINGADB_DATABASE_DATABASE=icingadb \
|
||||
-e ICINGADB_DATABASE_USER=icingadb \
|
||||
-e ICINGADB_DATABASE_PASSWORD=123456 \
|
||||
icinga/icingadb
|
||||
```
|
||||
|
||||
The container doesn't need any volumes and takes the environment variables.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
The environment variables consists of the key `ICINGADB_DATABASE_` and the configuration option name like `HOST` in uppercase.
|
||||
|
||||
```
|
||||
ICINGADB_DATABASE_HOST=mariadb-icingadb
|
||||
```
|
||||
|
||||
For more options, see the [Icinga DB configuration documentation].
|
||||
|
||||
### Connect via TLS
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--network icinga \
|
||||
--restart always \
|
||||
--name icingadb \
|
||||
-e ICINGADB_REDIS_HOST=redis-icingadb \
|
||||
-e ICINGADB_REDIS_PORT=6379 \
|
||||
-e ICINGADB_REDIS_PASSWORD=123456 \
|
||||
-e ICINGADB_REDIS_TLS=true \
|
||||
-e ICINGADB_REDIS_CERT='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
-e ICINGADB_REDIS_KEY='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
-e ICINGADB_REDIS_CA='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
-e ICINGADB_DATABASE_HOST=mariadb-icingadb \
|
||||
-e ICINGADB_DATABASE_PORT=3306 \
|
||||
-e ICINGADB_DATABASE_DATABASE=icingadb \
|
||||
-e ICINGADB_DATABASE_USER=icingadb \
|
||||
-e ICINGADB_DATABASE_PASSWORD=123456 \
|
||||
-e ICINGADB_DATABASE_TLS=true \
|
||||
-e ICINGADB_DATABASE_CERT='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
-e ICINGADB_DATABASE_KEY='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
-e ICINGADB_DATABASE_CA='[PEM-encoded content or path to a file (in a volume)]' \
|
||||
icinga/icingadb
|
||||
```
|
||||
|
||||
## Build it yourself
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Icinga/icingadb.git
|
||||
|
||||
docker build -t icingadb --file Containerfile .
|
||||
```
|
||||
|
||||
[Icinga DB configuration documentation]: https://icinga.com/docs/icingadb/latest/doc/03-Configuration/
|
||||
Loading…
Reference in a new issue