unbound-docker icon indicating copy to clipboard operation
unbound-docker copied to clipboard

pre-populate default unbound configuration when providing a volume mount

Open jhomen368 opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. When starting the unbound container with an empty volume mount to /opt/unbound/etc/unbound the container will refuse to start with the errors:

/opt/unbound/etc/unbound/unbound.conf:339: error: cannot open include file '/opt/unbound/etc/unbound/a-records.conf': No such file or directory
/opt/unbound/etc/unbound/unbound.conf:340: error: cannot open include file '/opt/unbound/etc/unbound/srv-records.conf': No such file or directory
/opt/unbound/etc/unbound/unbound.conf:346: error: cannot open include file '/opt/unbound/etc/unbound/forward-records.conf': No such file or directory
read /opt/unbound/etc/unbound/unbound.conf failed: 3 errors in configuration file
[1709013939] unbound[1:0] fatal error: Could not read config file: /opt/unbound/etc/unbound/unbound.conf. Maybe try unbound -dd, it stays on the commandline to see more errors, or unbound-checkconf

Describe the solution you'd like

Populate the default configuration files into /opt/unbound/etc/unbound when a volume is mounted to /opt/unbound/etc/unbound to allow the container to start up. This would behave similar to other containers like transmission, sabnzbd and many others which you mount /config to a volume but it pre-populates them with a working configuration so that the container can spin up prior to the user having to create files.

Describe alternatives you've considered

Creating a configMap per https://github.com/MatthewVance/unbound-docker/blob/master/k8s/deployment.yml

Additional context I am specifically trying to implement unbound into a Kubernetes cluster with volumes that get dynamically attached but because there are no default values I cannot enter the working container to put in the correct values.

jhomen368 avatar Feb 27 '24 06:02 jhomen368

Could this be looked in?

aikooo7 avatar Apr 17 '24 00:04 aikooo7