Open mcktr opened 3 years ago
I also ran into this issue. Is this something that is being looked at/ reviewed?
This looks strange, I would never think of mounting something into a different mount.
Looking at other issues like https://github.com/moby/moby/issues/26051 nested mounting has a lot of problems, so maybe having that /data
mount inside a named volume
seems not the right solution here.
Other issues regarding mount nesting: https://github.com/docker/for-mac/issues/5748 https://github.com/moby/moby/issues/26157 https://github.com/moby/moby/issues/40109 https://github.com/moby/moby/issues/39723
Instead of having - icinga-data:/data
, did you try to just use - ./data:/data
instead? @mcktr
The directory should be recursively owned by the icinga user and group.
These are parent directories of mount points for volumes you specified, so these were created by Docker, so Docker chose these permissions. Those are a fine default, but don't work out if another user should then use that directory structure.
So what could we do about this? We could run the entry point as root and try to fix things up there, but that's always something where you have to be really careful not to mess things up.
If we take a step back, I think the goal here is to add some config files unconditionally (i.e. always take that file, no matter if initializing a fresh node or running an existing instance). This could probably also be achieved by providing an additional directory where you can add custom configuration.
For now, you could try something like this as an workaround:
Mount the following file at /etc/icinga2-custom/icinga2.conf
:
include "/etc/icinga2/icinga2.conf"
include_recursive "/etc/icinga2-custom/conf.d"
Then mount your custom configuration in /etc/icinga2-custom/conf.d/something.conf
and set the command to icinga2 daemon -c /etc/icinga2-custom/icinga2.conf
.
I think the container should provide some mechanism like this, but getting this right requires some more effort, as this should then also work for things like /etc/icinga2/zones.d/
for example.
Hi,
if I start the container for the first time and I have additional files mounted (e.g. a IDO configuration file) the data directory got wrong permissions and Icinga 2 is not able to start. You have to first start the container without any additional file mounted, afterwards you can restart the container with additional mounted files.
The following docker-compose setup does not start.
Log:
Permissions:
The directory should be recursively owned by the icinga user and group.
It should be possible to start the container from the very beginning with mounted configuration files.
Best regards Michael