Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volume issues in docker compose for 2 container setup #200

Open
averageguyoriginal opened this issue Mar 9, 2023 · 1 comment
Open

volume issues in docker compose for 2 container setup #200

averageguyoriginal opened this issue Mar 9, 2023 · 1 comment

Comments

@averageguyoriginal
Copy link

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
- NET_ADMIN
ports:
- 443/tcp
- 53/tcp
- 53/udp
- 67/udp # Uncomment if you want to use Pi-Hole for DHCP
- 80/tcp
- 22/tcp
environment:
- FTLCONF_LOCAL_IPV4=192.168.1.254
- WEBPASSWORD=${WEBPASSWORD}
- PIHOLE_DNS_=192.168.1.253 #;192.168.1.13 #add second dns server here by removing #
volumes:
- ./pihole-unbound/pihole/volume:/etc/pihole
- ./pihole-unbound/pihole/config/hosts:/etc/hosts
- ./pihole-unbound/pihole/config/resolv.conf:/etc/resolv.conf
- ./pihole-unbound/pihole/config/dnsmasq:/etc/dnsmasq.d
- ./pihole-unbound/pihole/config/pihole-dhcp.conf:/etc/dnsmasq.d/02-pihole-dhcp.conf:rw
- ./pihole-unbound/pihole/config/pihole-static-dhcp.conf:/etc/dnsmasq.d/04-pihole-static-dhcp.conf:rw
- ./pihole-unbound/pihole/config/pihole-FTL.conf:/etc/pihole/pihole-FTL.conf
networks:
home:
ipv4_address: 192.168.1.254
restart: always
unbound:
container_name: unbound
image: mvance/unbound:latest
hostname: syn-unbound
mac_address: d0:ca:ab:cd:ef:02
ports:
- 53/tcp
- 53/udp
networks:
home:
ipv4_address: 192.168.1.253
restart: always

networks:
home:
driver: macvlan
driver_opts:
parent: enp1s0
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
ip_range: 192.168.1.252/30 # 192.168.1.253 and 192.168.1.254`

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
Copy link

quaoz commented Mar 18, 2023

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants