Just as an example, mine is defined to use a macvlan network I setup called home
, like so:
version: '3.3'
services:
pihole:
container_name: pihole
hostname: pihole-docker
depends_on:
- unbound
image: pihole/pihole:${PIHOLE_TAG}
#image: promofaux/adam-pihole
environment:
TZ: europe/London
FTLCONF_REPLY_ADDR4: 192.168.1.253
REV_SERVER: 'true'
REV_SERVER_DOMAIN: lan.arpa
REV_SERVER_TARGET: 192.168.0.1
REV_SERVER_CIDR: 192.168.0.0/16
SKIPGRAVITYONBOOT: 1
PIHOLE_DNS_: 8.8.8.8;8.8.4.4
WEBPASSWORD:
DNSMASQ_USER: 'root'
volumes:
- pihole_etc_pihole:/etc/pihole/
- pihole_etc_dnsmasqd:/etc/dnsmasq.d/
#- /volume1/copy/tmpVol/:/run/uncaught-logs/
cap_add:
- NET_ADMIN
mac_address: d0:ca:ab:cd:ef:fe
dns:
- 8.8.8.8
networks:
home:
ipv4_address: 192.168.1.253
restart: always
networks:
home:
external: true
volumes:
pihole_etc_pihole:
external: true
pihole_etc_dnsmasqd:
external: true
The network was set up with:
docker network create -d macvlan --subnet=192.168.0.0/23 --gateway=192.168.0.1 -o parent=eth0 home