AdGuard-WireGuard-Unbound-DNScrypt
AdGuard-WireGuard-Unbound-DNScrypt copied to clipboard
Docker version
Hi, thanks for a great project Would you mind if make a docker version of this pj Or tutorial how to use with adguard (docker)
Thanks.. my plan was to make these projects more understandable and get it working, I thought about building a docker container at some point , I know it is super easy but for a while I'm focus on my app development and not planning to make one now for there is a lot of guides on docker and these projects.
But the whole idea of this repo was for people to understand this network stuff better and other people to contribute to make it better so I will create a help issue for a docker image if anyone is interested. 🙏🙏🙏
Thanks to your great work I was able to set up a Docker with all the stuff except the VPN. It is installed on my raspberry via the PiVPN script. I'm going to continue an observation phase to see if everything works well and I'll publish my Docker.
In my case I don't need to use a VPN in a docker. So at first I will share my work without this option. On the other hand I use OpenVPN because with a PC that does not have administrator rights it works while with Wireguard it is not the case even if it is faster.
Hi @trinib,
Sorry for the wait but I was busy with other personal projects. Good news ! The Docker version is online and available here : https://hub.docker.com/r/oijkn/adguardhome-doh-dot
If you have any comments or questions don't hesitate to open an issue or to contact me.
Thanks again for your great work and sharing :)
@oijkn thanks I'll try it out in a while
Hi @trinib,
Sorry for the wait but I was busy with other personal projects. Good news ! The Docker version is online and available here : https://hub.docker.com/r/oijkn/adguardhome-doh-dot
If you have any comments or questions don't hesitate to open an issue or to contact me.
Thanks again for your great work and sharing :)
hi @oijkn i try to deploy that but i get in trouble for now i have my macvlan with name 'mymacvlanexist' how should i connect that to that 'mymacvlanexist' instead of create new one?
i think i should change this two part to connect network to 'mymacvlanexist' , but i don't know how.
networks:
macvlan0:
ipv4_address: 192.168.1.110 # IP of the container for AdGuardHome, configure it to your needs
and
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0 # Parent interface, configure it depending on your interface name
ipam:
config:
- subnet: 192.168.1.0/24 # Subnet of the container
gateway: 192.168.1.1 # Gateway of the network
ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.1.100 # Reserved for RPi Server (IP of the host)
@Monirzadeh can you list your network with : docker network ls and then show me detail with docker network inspect <network_name> ?
@oijkn Everything installed ok but this keeps happening(restarting)

Using Pi raspberry 64bit, installed docker for debian from https://docs.docker.com/engine/install/debian/
~It stated clone repo to docker data directory. I used location /var/lib/docker/ 🤷♂️ and I needed to be in sudo su root privilege mode~ You meant in docker-compose.yml. 😅
~I did not change anything in file~. I kept 192.168.1.110. My network has a [192.168.100.xxx] type address, do not know if that means anything
for nameserver in /etc/resolv.conf, 192.168.1.110 gets removed after restart so I used this guide : https://www.tecmint.com/set-permanent-dns-nameservers-in-ubuntu-debian/
BTW you have docker-compose up -d when docker compose up -d is the working command for me
let me know if you see what I did wrong
EDITED
crap I did not set path in volumes section 😅
hi @oijkn i try to deploy that but i get in trouble for now i have my macvlan with name 'mymacvlanexist' how should i connect that to that 'mymacvlanexist' instead of create new one?
i think i should change this two part to connect network to 'mymacvlanexist' , but i don't know how.
networks: macvlan0: ipv4_address: 192.168.1.110 # IP of the container for AdGuardHome, configure it to your needsand
networks: macvlan0: driver: macvlan driver_opts: parent: eth0 # Parent interface, configure it depending on your interface name ipam: config: - subnet: 192.168.1.0/24 # Subnet of the container gateway: 192.168.1.1 # Gateway of the network ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110 aux_addresses: rpi-srv: 192.168.1.100 # Reserved for RPi Server (IP of the host)
did you ran docker pull oijkn/adguardhome-doh-dot first ? cause when i did i got that error
@Monirzadeh can you list your network with :
docker network lsand then show me detail withdocker network inspect <network_name>?
NETWORK ID NAME DRIVER SCOPE
randomnumber1 MacConfig null local
randomnumber2 MyMacVlan macvlan local
randomnumber3 bridge bridge local
randomnumber4 host host local
randomnumber5 none null local
inspect that not contain Adgurde but some container connect to this macvlan
docker network inspect MyMacVlan output
[
{
"Name": "MyMacVlan",
"Id": "randomnumber2",
"Created": "2022-05-24T00:22:58.945708161+04:30",
"Scope": "local",
"Driver": "macvlan",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "192.168.1.0/26",
"IPRange": "192.168.1.2/24",
"Gateway": "192.168.1.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": "MacConfig"
},
"ConfigOnly": false,
"Containers": {
"containerid": {
"Name": "Radarr",
"EndpointID": "....",
"MacAddress": "virtualmacaddress",
"IPv4Address": "192.168.1.4/26",
"IPv6Address": ""
},
},
"Options": {
"parent": "enp2s0"
},
"Labels": {}
}
]
i use Portainer to manage containers
hi @oijkn i try to deploy that but i get in trouble for now i have my macvlan with name 'mymacvlanexist' how should i connect that to that 'mymacvlanexist' instead of create new one? i think i should change this two part to connect network to 'mymacvlanexist' , but i don't know how.
networks: macvlan0: ipv4_address: 192.168.1.110 # IP of the container for AdGuardHome, configure it to your needsand
networks: macvlan0: driver: macvlan driver_opts: parent: eth0 # Parent interface, configure it depending on your interface name ipam: config: - subnet: 192.168.1.0/24 # Subnet of the container gateway: 192.168.1.1 # Gateway of the network ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110 aux_addresses: rpi-srv: 192.168.1.100 # Reserved for RPi Server (IP of the host)did you ran
docker pull oijkn/adguardhome-doh-dotfirst ? cause when i did i got that error
i use Portainer and yes image downloaded
replace that to place you want to store data for example
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs
above config link
/opt/AdGuardHome/conf path in container to /containersFiles/adguardhome/conf path in host machine
replace that to place you want to store data for example
volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs - /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs - /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needsabove config link
/opt/AdGuardHome/confpath in container to/containersFiles/adguardhome/confpath in host machine

HI,
@trinib Your main problem seems to be that you are on a 64 bit architecture while my image is for 32 bit. I will try to build a multi-arch image to solve this problem.
Then if you are in a 192.168.100.0/24 subnet you have to adapt the network configuration accordingly. So you have to replace 192.168.1.110 by 192.168.100.110. I guess your gateway should be 192.168.100.1, right?
I realized, that I forgot in the README to indicate the modification of the network parameters in the files located in the network directory of the Github (I will make an update of the README).
And for <path_to_data>, I mean the real path where you will install the doker stuff for AdGuardHome. Example : /data/docker/adguardhome/. I usually use the /data of my HDD to store all my docker :)
@Monirzadeh I think you have to use something like that :
version: "2"
services:
adguardhome:
<all previous config...>
networks:
- MyMacVlan
networks:
MyMacVlan:
external: true
@oijkn thanks now i get same error that @trinib get as you mention it is becuse of image is 32bit i will wait to build a 64bit version. where do you announce 64bit version?
HI,
@trinib Your main problem seems to be that you are on a 64 bit architecture while my image is for 32 bit. I will try to build a multi-arch image to solve this problem.
Then if you are in a
192.168.100.0/24subnet you have to adapt the network configuration accordingly. So you have to replace 192.168.1.110 by 192.168.100.110. I guess your gateway should be192.168.100.1, right?I realized, that I forgot in the README to indicate the modification of the network parameters in the files located in the
network directoryof the Github (I will make an update of the README).And for
<path_to_data>, I mean the real path where you will install the doker stuff for AdGuardHome. Example :/data/docker/adguardhome/. I usually use the/dataof my HDD to store all my docker :)@Monirzadeh I think you have to use something like that :
version: "2" services: adguardhome: <all previous config...> networks: - MyMacVlan networks: MyMacVlan: external: true
Ahh i though it was these type of issues (architecture/network address) . I'll do adjustments and see how it goes. What about docker-compose up -d fixed to docker compose up -d (no-dash)
@oijkn Thanks so much again for the contribution.🔥🎉. when i add your docker links to readme and i'll finally close this💩
@oijkn when ever you feel like it or if you want to, it would be cool to make one with DNScrypt and Knot(soon to add, being setup/tested by @jo20201) with AGH. Those two are very customizable alternatives to cloudflared tunnel and unbound, to tell which has better security is hard for anyone to say unless you are network programmer and actually spends time comparing it lol.
I want DNScrypt and Knot for users who want extra features and like configuring stuff. it will be a personal preference option more advanced, unless in the future any becomes obsolete
@trinib ok I'll have a look at it as soon as possible
@trinib @Monirzadeh Can you type this command : dpkg --print-architecture and give me the result please ? Thank
dpkg --print-architecture
amd64
dpkg --print-architecture
amd64
It's not an Raspberry Pi 64 bit, right?
dpkg --print-architecture
amd64It's not an Raspberry Pi 64 bit, right?
no it is a pc
OK thanks you, @trinib can you type the same command please?
OK thanks you, @trinib can you type the same command please?

Hi @trinib & @Monirzadeh I just pushed an multi-arch docker image, can you try it, please ?

Hi @trinib & @Monirzadeh I just pushed an multi-arch docker image, can you try it, please ?
hi @oijkn o get bellow error
Deployment error
failed to deploy a stack: Creating Adguardhome ... [1A[2K Creating Adguardhome ... [31merror[0m [1B ERROR: for Adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 ERROR: for adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 Encountered errors while bringing up the project. : exit status 1
with this config
version: "2" # Docker Compose version for Portainer
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: Adguardhome
hostname: rpi-adguard
environment:
- PUID=1000 # User ID (UID)
- PGID=100 # Group ID (GID)
- TZ=Europe/London # Timezone
- LANG=en_US.UTF8 # Language
- LANGUAGE=en_US.UTF8 # Language (same as LANG)
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true" # Watchtower (auto update)
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs
cap_add:
- NET_ADMIN
networks:
- MyMacVlan
restart: unless-stopped
cron:
image: alpine:latest
container_name: cron
hostname: rpi-cron
command: crond -f -d 8
depends_on:
- adguardhome
volumes:
- /containersFiles/crontab/root:/etc/crontabs/root:z # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/tmp/unbound/root.hints # Configure '<path_to_data>' to your needs
restart: unless-stopped
networks:
MyMacVlan:
external: true
i don't know why ,but every time deployment stop with above error create network adguardhome-doh-dot_default too.
@oijkn i keep only getting

Hi @trinib & @Monirzadeh I just pushed an multi-arch docker image, can you try it, please ?
hi @oijkn o get bellow error
Deployment error failed to deploy a stack: Creating Adguardhome ... [1A[2K Creating Adguardhome ... [31merror[0m [1B ERROR: for Adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 ERROR: for adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 Encountered errors while bringing up the project. : exit status 1with this config
version: "2" # Docker Compose version for Portainer services: adguardhome: image: oijkn/adguardhome-doh-dot:latest container_name: Adguardhome hostname: rpi-adguard environment: - PUID=1000 # User ID (UID) - PGID=100 # Group ID (GID) - TZ=Europe/London # Timezone - LANG=en_US.UTF8 # Language - LANGUAGE=en_US.UTF8 # Language (same as LANG) tmpfs: - /run - /run/lock - /tmp # labels: # - "com.centurylinklabs.watchtower.enable=true" # Watchtower (auto update) volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs - /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs - /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs cap_add: - NET_ADMIN networks: - MyMacVlan restart: unless-stopped cron: image: alpine:latest container_name: cron hostname: rpi-cron command: crond -f -d 8 depends_on: - adguardhome volumes: - /containersFiles/crontab/root:/etc/crontabs/root:z # Configure '<path_to_data>' to your needs - /containersFiles/unbound/root.hints:/tmp/unbound/root.hints # Configure '<path_to_data>' to your needs restart: unless-stopped networks: MyMacVlan: external: truei don't know why ,but every time deployment stop with above error create network
adguardhome-doh-dot_defaulttoo.
Perhaps the problem is from service cron, network settings is missing because you are using existing macvlan network.
@oijkn i keep only getting
Can you provide me the result of the command : docker logs adguardhome ?
And yes you are using the good method to install Docker stuff.
issing bec
@oijkn so it is something that should fix in your side that is right?
container that created (can't start) has correct network (MyMacVlan) it just create adguardhome-doh-dot_default too
@oijkn i tried 32bit and it still do not work
@oijkn i keep only getting
Can you provide me the result of the command :
docker logs adguardhome?And yes you are using the good method to install Docker stuff.
nothing shows
@ i will try again with fresh install 32bit
@ i will try again with fresh install 32bit
Actually I'm trying to install an environment ARM64 over my Win10 to test my docker :)
@oijkn but is it strange 32bit works for you and not for me.. same pi and os
@oijkn but is it strange 32bit works for you and not for me.. same pi and os
Did you edit the eth0 files in the network directory?
Can you share your docker-compose.yml and eth0 files?
yes i edit it and i got some error
Can you share your docker-compose.yml and eth0 files?
i just change ip and docker location
Did you test this on raspbery pi hardware or from windows VM?
Did you test this on raspbery pi hardware or from windows VM?
Actually this docker stack run in my Rasp PI 4 8Go and I'm trying to mount an Qemu VM with arm64 to test it.
Did you test this on raspbery pi hardware or from windows VM?
Actually this docker stack run in my Rasp PI 4 8Go and I'm trying to mount an Qemu VM with arm64 to test it.
why you not using arm64 for the pi4?
@oijkn are you sure you did the same thing from your guide and see it work on a raspberry pi ? why are you even on a VM ?
Because my Raspberry Pi OS is an 32 bit and I can't test 64 bit, so I need to use a VM with arm64 architecture to validate my Docker image. When all is in place I will tell you if that works 😊
@oijkn
AGH works with this
version: "2"
services:
adguardhome:
image: adguard/adguardhome
container_name: adguardhome
ports:
- 53:53/tcp
- 53:53/udp
- 784:784/udp
- 853:853/tcp
- 3000:3000/tcp
- 80:80/tcp
- 443:443/tcp
volumes:
- ./workdir:/opt/adguardhome/work
- ./confdir:/opt/adguardhome/conf
restart: unless-stopped
cron:
image: alpine:latest
container_name: cron
hostname: rpi-cron
command: crond -f -d 8
depends_on:
- adguardhome
volumes:
- /home/pi/adguardhome-doh-dot/crontab/root:/etc/crontabs/root:z # Configure '<path_to_data>' to your needs
- /home/pi/adguardhome-doh-dot/unbound/root.hints:/tmp/unbound/root.hints # Configure '<path_to_data>' to your needs
restart: unless-stopped
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0 # Parent interface, configure it depending on your interface name
ipam:
config:
- subnet: 192.168.1.0/24 # Subnet of the container
gateway: 192.168.1.1 # Gateway of the network
ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.1.100
@oijkn
AGH works with this
version: "2" services: adguardhome: image: adguard/adguardhome container_name: adguardhome ports: - 53:53/tcp - 53:53/udp - 784:784/udp - 853:853/tcp - 3000:3000/tcp - 80:80/tcp - 443:443/tcp volumes: - ./workdir:/opt/adguardhome/work - ./confdir:/opt/adguardhome/conf restart: unless-stopped cron: image: alpine:latest container_name: cron hostname: rpi-cron command: crond -f -d 8 depends_on: - adguardhome volumes: - /home/pi/adguardhome-doh-dot/crontab/root:/etc/crontabs/root:z # Configure '<path_to_data>' to your needs - /home/pi/adguardhome-doh-dot/unbound/root.hints:/tmp/unbound/root.hints # Configure '<path_to_data>' to your needs restart: unless-stopped networks: macvlan0: driver: macvlan driver_opts: parent: eth0 # Parent interface, configure it depending on your interface name ipam: config: - subnet: 192.168.1.0/24 # Subnet of the container gateway: 192.168.1.1 # Gateway of the network ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110 aux_addresses: rpi-srv: 192.168.1.100
Yes but with the official Docker of AGH you don't have all the stuff with Unbound, Cloudflared & Stubby.
Today I'm not at home, so I will continue my tests tomorrow.
@trinib on my side I don't notice any error and the docker works correctly on ARM64 architecture. If below my configuration :
root@ubuntu:/data/adguardhome-doh-dot# dpkg --print-architecture
arm64
root@ubuntu:/data/adguardhome-doh-dot# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b4a4646d4e75 alpine:latest "crond -f -d 8" 3 minutes ago Up 2 minutes cron
b417925035d1 oijkn/adguardhome-doh-dot:latest "/lib/systemd/systemd" 3 minutes ago Up 2 minutes adguardhome
root@ubuntu:/data/adguardhome-doh-dot# cat /data/adguardhome-doh-dot/network/interfaces.d/eth0
# Ethernet interface (eth0)
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.11
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.1.14/32 dev macvlan-shim
# bring up the new network interface
up ip link set macvlan-shim up
# add a route to the container
post-up ip route add 192.168.1.11/32 dev macvlan-shim
root@ubuntu:/data/adguardhome-doh-dot# cat docker-compose.yml
version: "2"
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: adguardhome
hostname: rpi-adguard
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
- LANG=fr_FR.UTF8
- LANGUAGE=fr_FR.UTF8
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- ./adguardhome/conf:/opt/AdGuardHome/conf
- ./adguardhome/work:/opt/AdGuardHome/work
- ./unbound/root.hints:/var/lib/unbound/root.hints
cap_add:
- NET_ADMIN
networks:
macvlan0:
ipv4_address: 192.168.1.11 # IP of the container
restart: unless-stopped
cron:
image: alpine:latest
container_name: cron
hostname: rpi-cron
command: crond -f -d 8
depends_on:
- adguardhome
volumes:
- ./crontab/root:/etc/crontabs/root:z
- ./unbound/root.hints:/tmp/unbound/root.hints
restart: unless-stopped
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: 192.168.1.0/24 # Subnet of the container
gateway: 192.168.1.1 # Gateway of the container
ip_range: 192.168.1.10/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.1.10 # Reserved for RPi Server
@oijkn hi, do you have any progress on amd64?
@Monirzadeh yes the multi-arch also support amd64.
@oijkn i still get

@oijkn install this on raspberry pi4 64bit. you have configurations for VM and locations for a pc. that is why it is not working on pi
Actually this Docker is running on my Raspberry Pi 4 with OS 32 bit, without any problem.
Can you provide me your configuration files, like me above, please? Perhaps your problem comes from the network configuration...
# Ethernet interface (eth0)
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.11
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.1.14/32 dev macvlan-shim
# bring up the new network interface
up ip link set macvlan-shim up
# add a route to the container
post-up ip route add 192.168.1.11/32 dev macvlan-shim
version: "2"
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: adguardhome
hostname: rpi-adguard
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
- LANG=fr_FR.UTF8
- LANGUAGE=fr_FR.UTF8
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /home/pi/adguardhome-doh-dot/adguardhome/conf:/opt/AdGuardHome/conf
- /home/pi/adguardhome-doh-dot/adguardhome/work:/opt/AdGuardHome/work
- /home/pi/adguardhome-doh-dot/unbound/root.hints:/var/lib/unbound/root.hints
cap_add:
- NET_ADMIN
networks:
macvlan0:
ipv4_address: 192.168.1.11 # IP of the container
restart: unless-stopped
cron:
image: alpine:latest
container_name: cron
hostname: rpi-cron
command: crond -f -d 8
depends_on:
- adguardhome
volumes:
- /home/pi/adguardhome-doh-dot/crontab/root:/etc/crontabs/root:z
- /home/pi/adguardhome-doh-dot/unbound/root.hints:/tmp/unbound/root.hints
restart: unless-stopped
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: 192.168.1.0/24 # Subnet of the container
gateway: 192.168.1.1 # Gateway of the container
ip_range: 192.168.1.10/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.1.10 # Reserved for RPi Server
@Monirzadeh yes the multi-arch also support amd64.
@oijkn with this config
version: "2" # Docker Compose version for Portainer
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: Adguardhome
hostname: rpi-adguard
environment:
- PUID=1000 # User ID (UID)
- PGID=100 # Group ID (GID)
- TZ=Europe/London # Timezone
- LANG=en_US.UTF8 # Language
- LANGUAGE=en_US.UTF8 # Language (same as LANG)
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true" # Watchtower (auto update)
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs
cap_add:
- NET_ADMIN
networks:
- MyMacVlan
restart: unless-stopped
cron:
image: alpine:latest
container_name: cron
hostname: rpi-cron
command: crond -f -d 8
depends_on:
- adguardhome
volumes:
- /containersFiles/crontab/root:/etc/crontabs/root:z # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/tmp/unbound/root.hints # Configure '<path_to_data>' to your needs
restart: unless-stopped
networks:
MyMacVlan:
external: true
i get this error
Deployment error
failed to deploy a stack: Creating network "adguardhome-doh-dot_default" with the default driver Pulling adguardhome (oijkn/adguardhome-doh-dot:latest)...
Pulling cron (alpine:latest)...
Creating Adguardhome ...
Creating Adguardhome ...
merror ERROR: for Adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 ERROR: for adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting
do i something worg or need any specific change in my config?
@oijkn my network

Then if you are in a
192.168.100.0/24subnet you have to adapt the network configuration accordingly. So you have to replace 192.168.1.xxx by 192.168.100.xxx. I guess your gateway should be192.168.100.1, right?
@trinib like as said before, you have to adapt network configuration with your subnet.
@Monirzadeh I will try to embed the service cron in adguardhome to avoid the problem with creating default network.
@oijkn i tried that already and i got

@oijkn i tried that already and i got
@trinib
can you post complete network part of your config that you get this error
it is the same config file i just change network
.........
.........
networks:
macvlan0:
ipv4_address: 192.168.100.11 # IP of the container
.....
.....
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: 192.168.100.0/24 # Subnet of the container
gateway: 192.168.100.1 # Gateway of the container
ip_range: 192.168.100.10/28 # Usable Host IP Range: 192.168.1.97 - 192.168.100.110
aux_addresses:
rpi-srv: 192.168.100.10 # Reserved for RPi Server
it is "exactly" like above?
yea
@oijkn i tried that already and i got
@trinib Use docker-compose down and try to run docker-compose up -d or try to docker network rm the network that was previously created.
@oijkn why do you have a - in the middle ? how did you install docker?
@oijkn why do you have a - in the middle ? how did you install docker?
https://docs.docker.com/compose/reference/
@oijkn i still get after changing to 192.168.100.xxx

@oijkn why do you have a - in the middle ? how did you install docker?
i use docker compose up -d .. with no dash
@oijkn i know this is some simple issue . your not giving much to work with ..
@oijkn i know this is some simple issue . your not giving much to work with ..
before run that command be sure
docker network ls
has only bridge host and none
@oijkn why do you have a - in the middle ? how did you install docker?
i use docker compose up -d .. with no dash
The -d option if for detached mode (run containers in the background).
@oijkn why do you have a - in the middle ? how did you install docker?
i use docker compose up -d .. with no dash
The
-doption if for detached mode (run containers in the background).
no not -d .. docker-compose
@oijkn why do you have a - in the middle ? how did you install docker?
i use docker compose up -d .. with no dash
The
-doption if for detached mode (run containers in the background).no not -d .. docker
-compose
I don't understand, sorry. To use docker-compose.yml file you need to install docker-compose in your Raspberry Pi (a lot of tuto over internet). Or use Portainer to manage this stack 😉
can you please show how YOU installed docker.
@oijkn im gonna try a different method and see.. I will let you know
can you please show how YOU installed docker.
@trinib try this tuto : https://dev.to/elalemanyo/how-to-install-docker-and-docker-compose-on-raspberry-pi-1mo
@oijkn same Restarting (255) issue. freshly installed pi os
@oijkn same Restarting (255) issue. freshly installed pi os
@trinib to avoid any network configuration problem, can you post the result of the following commands :
- ip a
- ip route list
- dig 1.1.1.1 | grep "SERVER:"
- docker ps
- docker network ls
And also post the content of the docker-compose.yml and network/interfaces.d/eth0 files.
@Monirzadeh I just pushed the new version without the cron service in the docker-compose (which will solve your problem Creating network "adguardhome-doh-dot_default"), you have to clone the new project from Github and pul new image from dockerhub.
@oijkn

# Ethernet interface (eth0)
allow-hotplug eth0
iface eth0 inet static
address 192.168.100.100
netmask 255.255.255.0
gateway 192.168.100.1
dns-nameservers 192.168.100.110
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.100.99/32 dev macvlan-shim
# bring up the new network interface
up ip link set macvlan-shim up
# add a route to the container
post-up ip route add 192.168.100.110/32 dev macvlan-shim
version: "2"
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: adguardhome
hostname: rpi-adguard
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
- LANG=fr_FR.UTF8
- LANGUAGE=fr_FR.UTF8
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /home/pi/adguardhome-doh-dot/adguardhome/conf:/opt/AdGuardHome/conf
- /home/pi/adguardhome-doh-dot/adguardhome/work:/opt/AdGuardHome/work
- /home/pi/adguardhome-doh-dot/unbound/root.hints:/var/lib/unbound/root.hints
cap_add:
- NET_ADMIN
networks:
macvlan0:
ipv4_address: 192.168.100.110 # IP of the container
restart: unless-stopped
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: 192.168.100.0/24 # Subnet of the container
gateway: 192.168.100.1 # Gateway of the container
ip_range: 192.168.100.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.100.100 # Reserved for RPi Server
@trinib your network configuration is not good, I will give you the good one.
Edit: @trinib your ip address is not good to make range, the easiest way is to change the ip address of your rasp from 192.168.100.192 to 192.168.100.100
@Monirzadeh I just pushed the new version without the cron service in the docker-compose (which will solve your problem Creating network "adguardhome-doh-dot_default"), you have to clone the new project from Github and pul new image from dockerhub.
@trinib i remove cron part but again get this error
failed to deploy a stack: Creating Adguardhome ... [1A[2K Creating Adguardhome ... [31merror[0m [1B ERROR: for Adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 ERROR: for adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hint
this is my compose file something is wrong with this part
- /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints
but i don't know what it is
version: "2" # Docker Compose version for Portainer
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: Adguardhome
hostname: rpi-adguard
environment:
- PUID=1000 # User ID (UID)
- PGID=100 # Group ID (GID)
- TZ=Europe/London # Timezone
- LANG=en_US.UTF8 # Language
- LANGUAGE=en_US.UTF8 # Language (same as LANG)
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true" # Watchtower (auto update)
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /containersFiles/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs
- /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs
cap_add:
- NET_ADMIN
networks:
- MyMacVlan
restart: unless-stopped
networks:
MyMacVlan:
external: true
old image removed and portainer get new one. network not created anymore :+1:
@Monirzadeh so the new docker image works for you? 😊
@Monirzadeh so the new docker image works for you? blush
@oijkn not completely. it just crated but not starting
get this error while deploy
failed to deploy a stack: Creating Adguardhome ... [1A[2K Creating Adguardhome ... [31merror[0m [1B ERROR: for Adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hints (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 ERROR: for adguardhome Cannot start service adguardhome: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/containersFiles/unbound/root.hints" to rootfs at "/var/lib/unbound/root.hints": mount /containersFiles/unbound/root.hints:/var/lib/unbound/root.hint
@Monirzadeh can you type tree /containersFiles/ and post result?
tree /containersFiles/
@oijkn
tree adguardhome/ unbound/
adguardhome/
├── conf
└── work
unbound/
└── root.hints
other folder in containersFiles is related to other container
@Monirzadeh like is written in the guide in my github repo, you need to clone it and then put the path to docker-compose.yml file. In the result of the tree command I don't see all needed directories/files.
@oijkn is there any way to do that all inside portainer?
Portainer is a tool to manage only stack or container. You can't use git commands.
From your host, you must git clone my repo, to have all needed files/conf for running the stack.
You can git clone repo from your /containersFiles directory, that will create a subfolder adguardhome-doh-dot.
Portainer is a tool to manage only stack or container. You can't use git commands.
From your host, you must git clone my repo, to have all needed files/conf for running the stack.
You can git clone repo from your /containersFiles directory, that will create a subfolder adguardhome-doh-dot.
@oijkn i do this steps:
1 - i clone your repository in containersFiles/adguardhome-doh-dot
2. deploy this stack in portainer
version: "2" # Docker Compose version for Portainer
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: Adguardhome
hostname: rpi-adguard
environment:
- PUID=1000 # User ID (UID)
- PGID=100 # Group ID (GID)
- TZ=Eroup/London # Timezone
- LANG=en_US.UTF8 # Language
- LANGUAGE=en_US.UTF8 # Language (same as LANG)
tmpfs:
- /run
- /run/lock
- /tmp
# labels:
# - "com.centurylinklabs.watchtower.enable=true" # Watchtower (auto update)
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /containersFiles/adguardhome-doh-dot/adguardhome/conf:/opt/AdGuardHome/conf # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome-doh-dot/adguardhome/work:/opt/AdGuardHome/work # Configure '<path_to_data>' to your needs
- /containersFiles/adguardhome-doh-dot/unbound/root.hints:/var/lib/unbound/root.hints # Configure '<path_to_data>' to your needs
cap_add:
- NET_ADMIN
networks:
- MyMacVlan
restart: unless-stopped
networks:
MyMacVlan:
external: true
it is tree of adguardhome-doh-dot
adguardhome-doh-dot/
├── adguardhome
│ ├── conf
│ └── work
├── cloudflare
│ └── cloudflared.service
├── crontab
│ └── root
├── distribution
│ └── Dockerfile
├── docker-compose.yml
├── LICENSE
├── network
│ ├── interfaces
│ └── interfaces.d
│ └── eth0
├── README.md
├── stubby
│ └── stubby.yml
└── unbound
├── root.hints
└── unbound.conf
container deploy without error but is is not work. i cant attach to that in log i have bellow masseage
No log line matching the '' filter
Update: i clone repository and run that from terminal but again same result.
Before running our DNS resolvers, it is a good idea to turn off [systemd-resolved](https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html).
Edit the file /etc/systemd/resolved.conf as below :+1:
above part from read me is necessary or optional?
@Monirzadeh what's the result of the command : docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' adguardhome.
For example if it's 192.1.68.1.110, then you have to open your web browser to http://192.168.1.110:3000 and follow the installation wizard.
To answer to your question, editing /ets/systemd/resolved.conf it's recommended from @trinib guide.
@Monirzadeh what's the result of the command :
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' adguardhome.For example if it's 192.1.68.1.110, then you have to open your web browser to http://192.168.1.110:3000 and follow the installation wizard.
To answer to your question, editing
/ets/systemd/resolved.confit's recommended from @trinib guide.
it is return nothing
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' Adguardhome
in portainer that not get ip.
i am not sure but how should i change
containersFiles/adguardhome-doh-dot/network/interfaces.d/eth0
if it is my details of MyMacVlan?
IPV4 Subnet - 192.168.1.0/26
IPV4 Gateway - 192.168.1.1
IPV4 IP range - 192.168.1.2/24
my device name is enp1s3
should i change eth0 to enp1s3 or something like that?
update: is it wrong?
# Ethernet interface (eth0)
allow-hotplug enp2s0
iface enp2s0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.16
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.1.2/24 dev MyMacVlan
# bring up the new network interface
up ip link set MyMacVlan up
# add a route to the container
post-up ip route add 192.168.1.2/24 dev MyMacVlan
To answer to your question, editing /ets/systemd/resolved.conf it's recommended from @trinib guide.
so for now it is not the problem

@oijkn do you think i have some permission issue ?
@Monirzadeh you have to leave the default docker interface at eth0.
Try to use this conf :
# Ethernet interface (eth0)
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.16
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.1.14/32 dev macvlan-shim
# bring up the new network interface
up ip link set macvlan-shim up
# add a route to the container
post-up ip route add 192.168.1.xxx/32 dev macvlan-shim <<==== replace xxx by the IP address of your host
@Monirzadeh you have to leave the default docker interface at
eth0.Try to use this conf :
# Ethernet interface (eth0) allow-hotplug eth0 iface eth0 inet static address 192.168.1.15 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.16 # create a new network macvlan interface on top of eth0 pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge # assign an IP and the network space to the new network interface pre-up ip addr add 192.168.1.14/32 dev macvlan-shim # bring up the new network interface up ip link set macvlan-shim up # add a route to the container post-up ip route add 192.168.1.xxx/32 dev macvlan-shim <<==== replace xxx by the IP address of your host
@oijkn i test that and this not work
is it possible docker get variable environment from user and generate automatically all config files that it need? or some health check mechanism that clarify the problem?
@trinib your network configuration is not good, I will give you the good one.
Edit: @trinib your ip address is not good to make range, the easiest way is to change the ip address of your rasp from 192.168.100.192 to 192.168.100.100
@oijkn

Ok, I must investigate how to add some logs.... I'm sorry but in my Rasp PI all works good...

@trinib & @Monirzadeh
In the meantime, can you give me the result of the command : docker exec adguardhome journalctl
@oijkn container is runnig but i get this error
Error response from daemon: Container 16c247e132c13216349815da286faee08faf3268a810c797b1199b770466ba45 is restarting, wait until the container is running
is it possible to move all the config(in your git repository) to the container image?
@oijkn container is runnig but i get this error
Error response from daemon: Container 16c247e132c13216349815da286faee08faf3268a810c797b1199b770466ba45 is restarting, wait until the container is runningis it possible to move all the config(in your git repository) to the container image?
It's not a good idea because people will want/need to edit config depending their needs.
@oijkn container is runnig but i get this error
Error response from daemon: Container 16c247e132c13216349815da286faee08faf3268a810c797b1199b770466ba45 is restarting, wait until the container is runningis it possible to move all the config(in your git repository) to the container image?
It's not a good idea because people will want/need to edit config depending their needs.
i mean remove step that need to clone repository config files came with image and people can edit them after running or with environment variable. in this way always we have a docker that always run correctly and people can config that too
@oijkn

@oijkn were you using pi OS desktop or lite when testing docker?
docker exec adguardhome journalctl
I'm using the lite version. For your info I'm starting from scratch based on the official AdGuardHome docker image, I try to integrate third party applications like Unbound, Cloudflared etc...
I'll keep you posted as soon as it's ready because it's a lot of work and testing.
docker exec adguardhome journalctl
I'm using the lite version. For your info I'm starting from scratch based on the official AdGuardHome docker image, I try to integrate third party applications like Unbound, Cloudflared etc...
I'll keep you posted as soon as it's ready because it's a lot of work and testing.
thanks. It has to be a network thing.
ps
64bit OS does work on Pi4

@oijkn before I forget. You left out DNSStubListener. It's like saying to turn of systemd-resolved service when is just its DNSStubListener feature. It should be like systemd-resolved - DNSStubListener. .

@oijkn before I forget. You left out
DNSStubListener. It's like saying to turn of systemd-resolved service when is just its DNSStubListener feature. It should be likesystemd-resolved - DNSStubListener. .
In the guide, it's indicated to modify the value of DNSStubListener to no
