Icinga / Icinga/docker-icingaweb2

Create group icingaweb2 and users for daemon services

Open
#82 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
18
Forks
14
PR merge metrics
No merged PRs in 30d

Description

The Docker Image should add the same group like the Install from Source documentation.
https://icinga.com/docs/icinga-web-2/latest/doc/02-Installation/07-From-Source/#preparing-icinga-web-2-setup

Also it would be useful to create the users for the daemons like director, vspheredb, x509.
This would make the image better extendable for the daemon services.

At the moment, I do something like

services:
  icingaweb2:
    build:
      target: icingaweb2
  director-daemon:
    build:
      target: director-daemon
  vspheredb-daemon:
    build:
      target: vspheredb-daemon
  x509-daemon:
    build:
      target: x509-daemon

with the Dockerfile:

# Icinga Web 2
FROM icinga/icingaweb2:${ICINGAWEB2_VERSION} as icingaweb2

COPY --from=downloader /grafana /usr/share/icingaweb2/modules/grafana
COPY --from=ca-certificates:latest /usr/local/share/ca-certificates/*.crt /usr/local/share/ca-certificates/
USER root
RUN set -eux; \
        update-ca-certificates;
USER www-data

# Icinga Web 2 Director daemon
FROM icingaweb2 as director-daemon
USER root
RUN set -eux; \
        useradd -r -g www-data -d /var/lib/icingadirector -s /bin/false icingadirector; \
        install -d -o icingadirector -g www-data -m 0750 /var/lib/icingadirector;
ENTRYPOINT []
USER icingadirector
CMD ["/usr/bin/php","/usr/local/bin/icingacli","director","daemon","run"]

# Icinga Web 2 vSphere DB daemon
FROM icingaweb2 as vspheredb-daemon
USER root
RUN set -eux; \
        useradd -r -g www-data -d /var/lib/icingavspheredb -s /bin/false icingavspheredb; \
        install -d -o icingavspheredb -g www-data -m 0750 /var/lib/icingavspheredb;\
        install -d -o icingavspheredb -g www-data -m 755 /run/icinga-vspheredb;
ENTRYPOINT []
USER icingavspheredb
CMD ["/usr/bin/php","/usr/local/bin/icingacli","vspheredb","daemon","run"]

# Icinga Web 2 x509 daemon
FROM icingaweb2 as x509-daemon
ENTRYPOINT []
CMD ["/usr/bin/php","/usr/local/bin/icingacli","x509","jobs","run"]

If users, group, home folders and run folders already existed, it would be enough to override the user, entrypoint and command in the docker-compose.yml and don't require an Dockerfile and a build step.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository's Dockerfile and compare its image setup with the linked Icinga Web 2 "Install from Source" documentation. Check the docker-compose.yml usage shown in the issue and verify that the image provides the requested group, daemon users, home folders, and run folders so those services can override only the user, entrypoint, and command.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, php
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.