zilexa / Homeserver

Lightweight home server based on microservices, usable as desktop workstation
916 stars 56 forks source link

Problem with Unbound in docker-compose #9

Closed tiberio87 closed 2 years ago

tiberio87 commented 2 years ago

Hi, I have a problem with your docker compose. Here is the error that comes out when I start:

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/tiberio/docker/unbound/forward-records.conf" to rootfs at "/opt/unbound/etc/unbound/forward-records.conf": mount /home/tiberio/docker/unbound/forward-records.conf:/opt/unbound/etc/unbound/forward-records.conf (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

zilexa commented 2 years ago

The error says what you did wrong. You probably do not have this file: $DOCKERDIR/unbound/forward-records.conf if you don't have it, there is nothing that can be mapped into the container.

The mapping is handy if you want to know how Unbound is configured and use it to select the upstream DNS servers of your preference. But you have to create it (or get the default file from the maintainer GitHub account as starting point). If not, just use the default by removing the volume mapping in your Compose file.

I will remove the volume mapping from my docker compose example to prevent confusion.

Please always check the actual image/container documentation when you have questions.

zilexa commented 2 years ago

I've removed that line from the example and notice I also changed the image. See changelog for more info. https://github.com/zilexa/Homeserver/blob/f20c6ca6d2b75980e41af96729752fc85bed56ab/docker/docker-compose.yml#L97