chriscrowe / docker-pihole-unbound

Run Pi-Hole + Unbound on Docker
1.04k stars 270 forks source link

volume issues in docker compose for 2 container setup #200

Open averageguyoriginal opened 1 year ago

averageguyoriginal commented 1 year ago

my current compose looks like this

`version: '2'

services: pihole: container_name: pihole image: pihole/pihole:latest hostname: pi-hole mac_address: d0:ca:ab:cd:ef:01 cap_add: # Uncomment if you want to use Pi-Hole for DHCP

networks: home: driver: macvlan driver_opts: parent: enp1s0 ipam: config:

when i run it it gives below error

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/pie/dockerchris/pihole-unbound/pihole/config/resolv.conf" to rootfs at "/etc/resolv.conf": mount /home/pie/dockerchris/pihole-unbound/pihole/config/resolv.conf:/etc/resolv.conf (via /proc/self/fd/6), flags: 0x5000: 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

beore this volume i was using the original volumes mention in the example but they also give same error. i have no idea how to make it work. please help me

quaoz commented 1 year ago

It's trying to mount 'resolv.conf' as a directory not a file. Try doing touch resolv.conf to create the file (you might need to do rmdir resolve.conf if it has created a directory there) then restarting the container. You will probably also have to do it for 'pihole-dhcp.conf', 'pihole-static-dhcp.conf', '04-pihole-static-dhcp.conf' and 'pihole-FTL.conf'.