From e34dcd96659b8680334a3d869ef2f251ef8cdc27 Mon Sep 17 00:00:00 2001 From: Peter Schiffer <3899107+pschiffe@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:18:05 +0100 Subject: [PATCH] Allow pdns containers to run rootless --- pdns-mysql/Dockerfile | 3 +++ pdns-mysql/Dockerfile.alpine | 3 +++ pdns-pgsql/Dockerfile | 3 +++ pdns-pgsql/Dockerfile.alpine | 3 +++ pdns-recursor/Dockerfile | 2 +- pdns-recursor/Dockerfile.alpine | 2 +- 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pdns-mysql/Dockerfile b/pdns-mysql/Dockerfile index c65817d..fb728c7 100644 --- a/pdns-mysql/Dockerfile +++ b/pdns-mysql/Dockerfile @@ -13,6 +13,9 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && dnf --setopt 'tsflags=' install pdns-backend-mysql \ && dnf clean all +RUN mkdir -p /run/pdns \ + && chown -R pdns: /etc/pdns /run/pdns + COPY pdns.conf.tpl docker-entrypoint.sh / ENV VERSION=4.8 \ diff --git a/pdns-mysql/Dockerfile.alpine b/pdns-mysql/Dockerfile.alpine index f06ba23..e10484c 100644 --- a/pdns-mysql/Dockerfile.alpine +++ b/pdns-mysql/Dockerfile.alpine @@ -12,6 +12,9 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && apk add --allow-untrusted subvars.apk \ && rm -rf subvars.apk /var/cache/apk/* +RUN mkdir -p /run/pdns \ + && chown -R pdns: /etc/pdns /run/pdns + COPY pdns.conf.tpl docker-entrypoint.sh / ENV VERSION=4.8 \ diff --git a/pdns-pgsql/Dockerfile b/pdns-pgsql/Dockerfile index eb8baa8..36c714b 100644 --- a/pdns-pgsql/Dockerfile +++ b/pdns-pgsql/Dockerfile @@ -13,6 +13,9 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && dnf --setopt 'tsflags=' install pdns-backend-postgresql \ && dnf clean all +RUN mkdir -p /run/pdns \ + && chown -R pdns: /etc/pdns /run/pdns + COPY pdns.conf.tpl docker-entrypoint.sh / ENV VERSION=4.8 \ diff --git a/pdns-pgsql/Dockerfile.alpine b/pdns-pgsql/Dockerfile.alpine index 6d44ea0..2617441 100644 --- a/pdns-pgsql/Dockerfile.alpine +++ b/pdns-pgsql/Dockerfile.alpine @@ -12,6 +12,9 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && apk add --allow-untrusted subvars.apk \ && rm -rf subvars.apk /var/cache/apk/* +RUN mkdir -p /run/pdns \ + && chown -R pdns: /etc/pdns /run/pdns + COPY pdns.conf.tpl docker-entrypoint.sh / ENV VERSION=4.8 \ diff --git a/pdns-recursor/Dockerfile b/pdns-recursor/Dockerfile index f6b1221..39dce9f 100644 --- a/pdns-recursor/Dockerfile +++ b/pdns-recursor/Dockerfile @@ -11,7 +11,7 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && dnf clean all RUN mkdir -p /etc/pdns-recursor/api.d /run/pdns-recursor \ - && chown -R pdns-recursor: /etc/pdns-recursor/api.d /run/pdns-recursor + && chown -R pdns-recursor: /etc/pdns-recursor /run/pdns-recursor COPY recursor.conf.tpl docker-entrypoint.sh / diff --git a/pdns-recursor/Dockerfile.alpine b/pdns-recursor/Dockerfile.alpine index ac5a9fa..841c8e3 100644 --- a/pdns-recursor/Dockerfile.alpine +++ b/pdns-recursor/Dockerfile.alpine @@ -9,7 +9,7 @@ RUN arch=$([ "$(arch)" = 'aarch64' ] && echo -n 'arm64' || echo -n 'amd64') \ && rm -rf subvars.apk /var/cache/apk/* RUN mkdir -p /etc/pdns/api.d /var/run/pdns-recursor \ - && chown -R recursor: /etc/pdns/api.d /var/run/pdns-recursor + && chown -R recursor: /etc/pdns /var/run/pdns-recursor COPY recursor.conf.tpl docker-entrypoint.sh /