A docker image to run AdGuardHome as a non-root user
1.5K
AdGuard Home build from source to run as a non-root user.
For full details, visit the github repository
useradd -M --system -s /usr/sbin/nologin adguardhome
docker run --rm --cap-drop ALL --cap-add CAP_NET_BIND_SERVICE \
-v ./etc-adguardhome:/etc/adguardhome --user 0:0 \
lkpot/adguardhome
Once the container runs, perform the initial setup via http://<server_address>:3000 Make sure to change the ownership of the created data directory to the earlier created adguardhome user.
chown -R "$(id -u adguardhome):$(id -g adguardhome)" etc-adguardhome
docker run --rm --cap-drop ALL --cap-add CAP_NET_BIND_SERVICE \
-v ./etc-adguardhome:/etc/adguardhome --user "$(id -u adguardhome):$(id -g adguardhome) \
lkpot/adguardhome
For docker compose, you may want to create an environment file (.env) for easier user mapping.
echo -e "UID=$(id -u adguardhome )\nGID=$(id -g adguardhome )" > .env
services:
adguard:
container_name: adguardhome
image: lkpot/adguardhome
cap_drop:
- All
cap_add:
- CAP_NET_BIND_SERVICE
expose:
- 53:53/tcp
- 53:53/udp
- 80:80/tcp
- 443:443/tcp
user: ${UID}:${GID}
volumes:
- ./etc-adguardhome:/etc/adguardhome
restart: unless-stopped
Content type
Image
Digest
sha256:4eba190d3…
Size
41.8 MB
Last updated
4 months ago
docker pull lkpot/adguardhome