pschiffe / docker-pdns

Docker images for PowerDNS
MIT License
274 stars 81 forks source link

Include pdns-backend-pipe #52

Closed TijZwa closed 3 years ago

pschiffe commented 3 years ago

Thanks for the PR. Could you add the pdns-backend-pipe package also to the Fedora based image, so the images are kept in sync?

Also, what's your use case for this backend?

TijZwa commented 3 years ago

Sorry for my late response! The use case for this backend is the usage of a dynamic reverse zone backend, found at https://github.com/endreszabo/PowerDNS-Dynamic-Reverse-Backend

But, I found out the the following python modules needs to be installed: netaddr, py-radix, ipy, pyyaml. I don't know if you want to include this modules in the docker images? If not, it might be a better idea for me to build a new layer on top of this image and close this PR.

pschiffe commented 3 years ago

No worries, thanks for the reply. Looking at that project, I'm afraid it would be too much deps and complexity added to this repo. Feel free to use this repo as a base for your images with this additional backend included and let me know once you have it working. Thanks!

TijZwa commented 3 years ago

Thanks! I figured it out. For reference, I've included the docker file below.

I'm using the following env variables:

  PDNS_launch: pipe,gmysql
  PDNS_pipe_command: /var/lib/powerdns/scripts/pdns-dynamic-reverse-backend.py
  PDNS_pipe_timeout: 500
FROM alpine:3.12

# Install packages
RUN apk add --no-cache \
    mariadb-client \
    pdns \
    pdns-backend-mysql \
    pdns-backend-pipe \
    pdns-doc \
    py3-pip \
    python3

# Install build dependencies, needed to build py-radix
RUN apk add --no-cache \
    build-base \ 
    python3-dev

# Install python modules
RUN pip3 install --no-cache-dir \
    envtpl \
    ipy \
    netaddr \
    py-radix \
    pyyaml

# PowerDNS variables
ENV VERSION=4.2 \
  PDNS_guardian=yes \
  PDNS_setuid=pdns \
  PDNS_setgid=pdns \
  PDNS_launch=gmysql

# Template files
COPY pdns.conf.tpl /
COPY docker-entrypoint.sh /

# Ensure the x permission on the docker-entrypoint
RUN chmod +x /docker-entrypoint.sh

# Entrypoint, as copied from pschiffe/docker-pdns (see README.md)
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "/usr/sbin/pdns_server" ]