Docker: Pi-Hole - Failed to set capabilities on file `/usr/bin/pihole-FTL' (Operation not supported)

root's picture

Got this error today when I started a docker container with the latest available image from docker hub (2022.02.1):

HOST=sonic HOST_FROM=10.18.11.32 MESSAGE="Failed to set capabilities on file `/usr/bin/pihole-FTL' (Operation not supported)" MSGID=pihole PID=4630 PROGRAM=pihole SOURCE=s_network
HOST=sonic HOST_FROM=10.18.11.32 MESSAGE="The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file" MSGID=pihole PID=4630 PROGRAM=pihole SOURCE=s_network
HOST=sonic HOST_FROM=10.18.11.32 MESSAGE="ERROR: Unable to set capabilities for pihole-FTL. Cannot run as non-root." MSGID=pihole PID=4630 PROGRAM=pihole SOURCE=s_network
HOST=sonic HOST_FROM=10.18.11.32 MESSAGE="       If you are seeing this error, please set the environment variable 'DNSMASQ_USER' to the value 'root'" MSGID=pihole PID=4630 PROGRAM=pihole SOURCE=s_network

UPS :)

Luckily for me, the solution was in the message so all I had to do was to add the following environment variable DNSMASQ_USER=root on container's configuration file.

sonic:services# docker inspect pihole | egrep "Env|DNS"
            "Env": [
                "DNSMASQ_USER=root",

If you want to start with such environment variable you use -e.
Example:

docker run -d --name pihole -e DNSMASQ_USER=root pihole/pihole

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root