PiHole running on Docker

Hey,

If anyone is interested in PiHole within VyOS 1.4. Here is the commands to do so:

!!!CHANGE THE PASSWORD BEFORE INSTALLING!!!

sudo mkdir -p /config/docker/pihole/dnsmasq.d/
sudo mkdir -p /config/docker/pihole/etc/
sudo chmod -R 777 /config/docker/pihole/*
add container image docker.io/pihole/pihole
configure
set container name pihole allow-host-networks
set container name pihole cap-add ‘net-admin’
set container name pihole cap-add ‘net-raw’
set container name pihole environment WEBPASSWORD value ‘changeme’
set container name pihole image ‘pihole’
set container name pihole memory ‘1024’
set container name pihole port dhcp destination ‘67’
set container name pihole port dhcp protocol ‘udp’
set container name pihole port dhcp source ‘67’
set container name pihole port dns_tcp destination ‘53’
set container name pihole port dns_tcp protocol ‘tcp’
set container name pihole port dns_tcp source ‘53’
set container name pihole port dns_udp destination ‘53’
set container name pihole port dns_udp protocol ‘udp’
set container name pihole port dns_udp source ‘53’
set container name pihole port http destination ‘80’
set container name pihole port http protocol ‘tcp’
set container name pihole port http source ‘8080’
set container name pihole restart ‘always’
set container name pihole volume pihole_dnsmasq destination ‘/etc/dnsmasq.d/’
set container name pihole volume pihole_dnsmasq source ‘/config/docker/pihole/dnsmasq.d/’
set container name pihole volume pihole_etc destination ‘/etc/pihole/’
set container name pihole volume pihole_etc source ‘/config/docker/pihole/etc/’
commit
save

Once up and running go to http://[YOUR LAN IP]:80 and login with the password you set in the environment commands.

2 Likes

Hi,

That’s an interesting idea.
Just in case, VyOS 1.4 has support for containers.
The VyOS container implementation is based on Podmanhttps://podman.io/ as a deamonless container engine.
https://docs.vyos.io/en/latest/configuration/container/index.html#container