JamesTurland / JimsGarage

Homelab Goodies
2.18k stars 485 forks source link

Unbound in docker dropping dns_net network after startup #99

Closed bmwhd123 closed 3 months ago

bmwhd123 commented 4 months ago

I have been using your examples to run pihole and unbound in containers on docker (deployed with portainer on raspberry pi). It worked well the first time I deployed it but upon a reboot of the raspberry, the unbound container starts, gets the local IP on the proper subnet that is configured for pihole to forward to, but then after a few seconds drops off that local network. In the unbound container log I'm seeing a single error repeated over and over: exec /unbound.sh exec format error

Here's my yml file:

Docker Compose version

version: "3"

networks: dns_net: driver: bridge ipam: config:

Define services (containers to be created)

services:

Service name: pihole

pihole:

Name of the container instance

container_name: pihole

# Image to use for this container
# Use the specified version of the pihole image
image: pihole/pihole:2024.07.0
networks:
  dns_net:
    ipv4_address: 172.18.0.7

# Expose and map ports (host:container)
ports:
  - "53:53/tcp" # DNS (TCP)
  - "53:53/udp" # DNS (UDP)
  - "7300:80/tcp" # Web UI HTTP

# Environment variables
environment:
  TZ: "America/Chicago" # Time Zone; Update this to your time zone
  WEBPASSWORD: "password" # Admin password for web UI; Change this to your desired admin password
  PIHOLE_DNS_: '172.18.0.8#5053'

# Mount volumes for persistent data
volumes:
  - "/data/pihole/data/pihole:/etc/pihole" # Pi-hole data
  - "/data/pihole/data/dnsmasq:/etc/dnsmasq.d" # dnsmasq data

# Restart policy for the container when it exits
restart: unless-stopped

# DNS servers for this container to use
dns:
 - 127.0.0.1 # Localhost for internal resolution
 - 1.1.1.1 # Cloudflare DNS for external resolution

unbound: container_name: unbound image: mvance/unbound:latest # remember to change this if you're using rpi networks: dns_net: ipv4_address: 172.18.0.8 volumes:

bmwhd123 commented 3 months ago

Never mind. Fat fingered the path to the rpi version. All good.

bmwhd123 commented 3 months ago

Closing as resolved. Wrong image link used.