Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Version 1.21.1 (with Redis Support) #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mzarnowski
Copy link

Closes #188 and in a way #184

Verified by building and running the image locally (similarily to #190):

The new version starts:

podman run --detach --net=foo-net --name=foo-unbound -v ${HOME}/unbound-docker/1.21.1/unbound.conf:/opt/unbound/etc/unbound/unbound.conf:ro,z -p "5353:53/udp" -p "5353:53/tcp" -it localhost/unbound:1.21.1

Screenshot 2024-10-17 at 10 51 23

and responds on DNS request:

dig +short wykop.pl @localhost -p 5353
podman logs foo-unbound

Screenshot 2024-10-17 at 10 53 06

The functional diff is as follows:

diff -u /Users/marek/workspace/unbound-docker/1.20.0/ /Users/marek/workspace/unbound-docker/1.21.1/
diff -u /Users/marek/workspace/unbound-docker/1.20.0/Dockerfile /Users/marek/workspace/unbound-docker/1.21.1/Dockerfile
--- /Users/marek/workspace/unbound-docker/1.20.0/Dockerfile	2024-10-17 11:05:09
+++ /Users/marek/workspace/unbound-docker/1.21.1/Dockerfile	2024-10-17 11:06:33
@@ -53,9 +53,9 @@
 LABEL maintainer="Matthew Vance"
 
 ENV NAME=unbound \
-    UNBOUND_VERSION=1.20.0 \
-    UNBOUND_SHA256=56b4ceed33639522000fd96775576ddf8782bb3617610715d7f1e777c5ec1dbf \
-    UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.20.0.tar.gz
+    UNBOUND_VERSION=1.21.1 \
+    UNBOUND_SHA256=3036d23c23622b36d3c87e943117bdec1ac8f819636eb978d806416b0fa9ea46 \
+    UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.21.1.tar.gz
 
 WORKDIR /tmp/src
 
@@ -69,6 +69,7 @@
       ca-certificates \
       ldnsutils \
       libevent-2.1-7 \
+      libhiredis-dev \
       libexpat1 \
       libprotobuf-c-dev \
       protobuf-c-compiler && \
@@ -76,7 +77,7 @@
     echo "${UNBOUND_SHA256} *unbound.tar.gz" | sha256sum -c - && \
     tar xzf unbound.tar.gz && \
     rm -f unbound.tar.gz && \
-    cd unbound-1.20.0 && \
+    cd unbound-1.21.1 && \
     groupadd _unbound && \
     useradd -g _unbound -s /dev/null -d /etc _unbound && \
     ./configure \
@@ -86,6 +87,7 @@
         --with-username=_unbound \
         --with-ssl=/opt/openssl \
         --with-libevent \
+        --with-libhiredis \
         --with-libnghttp2 \
         --enable-dnstap \
         --enable-tfo-server \
@@ -120,6 +122,7 @@
       ca-certificates \
       ldnsutils \
       libevent-2.1-7 \
+      libhiredis0.14 \
       libnghttp2-14 \
       libexpat1 \
       libprotobuf-c1 && \
Common subdirectories: /Users/marek/workspace/unbound-docker/1.20.0/data and /Users/marek/workspace/unbound-docker/1.21.1/data
diff -u /Users/marek/workspace/unbound-docker/1.20.0/data/ /Users/marek/workspace/unbound-docker/1.21.1/data/
Common subdirectories: /Users/marek/workspace/unbound-docker/1.20.0/data/opt and /Users/marek/workspace/unbound-docker/1.21.1/data/opt
diff -u /Users/marek/workspace/unbound-docker/1.20.0/data/unbound.sh /Users/marek/workspace/unbound-docker/1.21.1/data/unbound.sh
--- /Users/marek/workspace/unbound-docker/1.20.0/data/unbound.sh	2024-10-17 11:05:09
+++ /Users/marek/workspace/unbound-docker/1.21.1/data/unbound.sh	2024-10-17 11:09:47
@@ -42,6 +42,14 @@
     ###########################################################################
     # BASIC SETTINGS
     ###########################################################################
+    # Modules used by unbound. Default is "validator iterator"
+    # Uncomment to enable Redis support (configured at the bottom  of the file)
+    # modules:
+    #  validator - validates the security fingerprints on data sets
+    #  cachedb - persistent store for data from previous queries
+    #  iterator - sends queries to the hierarchical DNS servers that own the data
+    # module-config: "validator cachedb iterator"
+    
     # Time to live maximum for RRsets and messages in the cache. If the maximum
     # kicks in, responses to clients still get decrementing TTLs based on the
     # original (larger) values. When the internal TTL expires, the cache item
@@ -388,6 +396,31 @@
 
 remote-control:
     control-enable: no
+
+###########################################################################
+# REDIS
+###########################################################################
+# Requires enabling 'cachedb' module in the server's 'module-config' section.
+# When enabled, Redis works  as  a second level cache.
+# This module interacts with the serve-expired-* options and  will  reply
+# with expired data if Unbound is configured for that.
+#
+# Unbound never removes data stored in the Redis  server, so cache-size and
+# eviction policy should be set on the Redis side.
+#
+# cachedb:
+    ###########################################################################
+    # CONNECTION SETTINGS
+    ###########################################################################
+    # Replace the default "testframe" db with Redis
+    # backend: "redis"
+
+    # ip address or domain  name  of  the  Redis server.
+    # defaults to 127.0.0.1
+    # redis-server-host: 127.0.0.1
+
+    # The TCP port number of the Redis server. Defaultsto 6379.
+    # redis-server-port: 6379
 EOT
 fi
 
@@ -398,4 +431,4 @@
 chown _unbound:_unbound /opt/unbound/etc/unbound/var && \
 /opt/unbound/sbin/unbound-anchor -a /opt/unbound/etc/unbound/var/root.key
 
-exec /opt/unbound/sbin/unbound -d -c /opt/unbound/etc/unbound/unbound.conf
\ No newline at end of file
+exec /opt/unbound/sbin/unbound -d -c /opt/unbound/etc/unbound/unbound.conf

@vincejv
Copy link

vincejv commented Oct 30, 2024

1.22 already merged to main and version bump should be a separate PR when adding stuff like "redis support"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can we please have a 1.21.1 docker image?
2 participants