Skip to content

11notes/docker-unbound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

banner

UNBOUND

size5pxversion5pxpulls5px5pxswiss_made

Run unbound rootless, distroless and secure by default!

INTRODUCTION πŸ“’

Unbound is a validating, recursive, caching DNS resolver. It is designed to be fast and lean and incorporates modern features based on open standards.

SYNOPSIS πŸ“–

What can I do with this? Run Unbound distroless and rootless for maximum security.

UNIQUE VALUE PROPOSITION πŸ’Ά

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.

COMPARISON 🏁

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

VOLUMES πŸ“

  • /unbound/etc - Directory of your configuration

COMPOSE βœ‚οΈ

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: true

To find out how you can change the default UID/GID of this container image, consult the how-to.changeUIDGID section of my RTFM

DEFAULT SETTINGS πŸ—ƒοΈ

Parameter Value Description
user docker user name
uid 1000 user identifier
gid 1000 group identifier
home /unbound home directory of user docker

ENVIRONMENT πŸ“

Parameter Value Default
TZ Time Zone
DEBUG Will activate debug option for container image and app (if available)

MAIN TAGS 🏷️

These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.

There is no latest tag, what am I supposed to do about updates?

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!

REGISTRIES ☁️

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

SOURCE πŸ’Ύ

PARENT IMAGE πŸ›οΈ

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:

BUILT WITH 🧰

GENERAL TIPS πŸ“Œ

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

ElevenNotesℒ️

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)

About

Run unbound rootless, distroless and secure by default!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •