Run unbound rootless, distroless and secure by default!
Unbound is a validating, recursive, caching DNS resolver. It is designed to be fast and lean and incorporates modern features based on open standards.
What can I do with this? Run Unbound distroless and rootless for maximum security.
Why should I run this image and not the other image(s) that already exist? Good question! Because ...
Important
- ... this image runs rootless as 1000:1000
- ... this image has no shell since it is distroless
- ... this image is auto updated to the latest version via CI/CD
- ... this image has a health check
- ... this image runs read-only
- ... this image is automatically scanned for CVEs before and after publishing
- ... this image is created via a secure and pinned CI/CD process
- ... this image is very small
If you value security, simplicity and optimizations to the extreme, then this image might be for you.
Below you find a comparison between this image and the most used or original one.
| image | size on disk | init default as | distroless | supported architectures |
|---|---|---|---|---|
| klutchell/unbound | 14MB | 1000:1000 | β | amd64, arm64, armv6, armv7 |
- /unbound/etc - Directory of your configuration
name: "dns"
x-lockdown: &lockdown
# prevents write access to the image itself
read_only: true
# prevents any process within the container to gain more privileges
security_opt:
- "no-new-privileges=true"
services:
redis:
image: "11notes/redis:7.4.5"
<<: *lockdown
environment:
REDIS_PASSWORD: "${REDIS_PASSWORD}"
TZ: "Europe/Zurich"
networks:
backend:
volumes:
- "redis.etc:/redis/etc"
- "redis.var:/redis/var"
tmpfs:
- "/run:uid=1000,gid=1000"
restart: "always"
unbound:
depends_on:
redis:
condition: "service_healthy"
restart: true
image: "11notes/unbound:1.24.1"
<<: *lockdown
environment:
TZ: "Europe/Zurich"
volumes:
- "unbound.etc:/unbound/etc"
ports:
- "53:53/udp"
- "53:53/tcp"
networks:
frontend:
backend:
sysctls:
net.ipv4.ip_unprivileged_port_start: 53
restart: "always"
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# β DEMO CONTAINER - DO NOT USE IN PRODUCTION! β
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# used to view the redis database
demo-redis-gui:
image: "redis/redisinsight"
environment:
RI_REDIS_HOST0: "redis"
RI_REDIS_PASSWORD0: "${REDIS_PASSWORD}"
TZ: "Europe/Zurich"
ports:
- "3000:5540/tcp"
networks:
frontend:
backend:
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# β DEMO CONTAINER - DO NOT USE IN PRODUCTION! β
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# used to generate 100k DNS queries
dnspyre:
depends_on:
unbound:
condition: "service_healthy"
restart: true
image: "11notes/distroless:dnspyre"
command: "--server unbound -c 10 -n 3 -t A --prometheus ':3000' https://raw.githubusercontent.com/11notes/static/refs/heads/main/src/benchmarks/dns/fqdn/10000"
read_only: true
environment:
TZ: "Europe/Zurich"
networks:
frontend:
volumes:
redis.etc:
redis.var:
unbound.etc:
networks:
frontend:
backend:
internal: trueTo find out how you can change the default UID/GID of this container image, consult the how-to.changeUIDGID section of my RTFM
| Parameter | Value | Description |
|---|---|---|
user |
docker | user name |
uid |
1000 | user identifier |
gid |
1000 | group identifier |
home |
/unbound | home directory of user docker |
| Parameter | Value | Default |
|---|---|---|
TZ |
Time Zone | |
DEBUG |
Will activate debug option for container image and app (if available) |
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
It is of my opinion that the :latest tag is dangerous. Many times, Iβve introduced breaking changes to my images. This would have messed up everything for some people. If you donβt want to change the tag to the latest semver, simply use the short versions of semver. Instead of using :1.24.1 you can use :1 or :1.24. Since on each new version these tags are updated to the latest version of the software, using them is identical to using :latest but at least fixed to a major or minor version.
If you still insist on having the bleeding edge release of this app, simply use the :rolling tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!
docker pull 11notes/unbound:1.24.1
docker pull ghcr.io/11notes/unbound:1.24.1
docker pull quay.io/11notes/unbound:1.24.1
Important
This image is not based on another image but uses scratch as the starting layer. The image consists of the following distroless layers that were added:
- 11notes/distroless - contains users, timezones and Root CA certificates, nothing else
- 11notes/distroless:dnslookup - app to execute DNS lookups
Tip
- Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
- Use Letβs Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the releases for breaking changes. If you have any problems with using this image simply raise an issue, thanks. If you have a question or inputs please create a new discussion instead of an issue. You can find all my other repositories on github.
created 23.10.2025, 07:20:06 (CET)

