-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
54 lines (46 loc) · 1.89 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM alpine:3.9 as base
ENV REFRESHED_AT="2019-10-10" \
POWERDNS_VERSION="4.3.1" \
BUILD_DEPS="g++ make mariadb-dev postgresql-dev sqlite-dev curl boost-dev mariadb-connector-c-dev" \
RUN_DEPS="bash libpq sqlite-libs libstdc++ libgcc mariadb-client postgresql-client sqlite mariadb-connector-c lua-dev curl-dev boost-program_options" \
POWERDNS_MODULES="bind gmysql gpgsql gsqlite3"
FROM base AS build
RUN apk --update add $BUILD_DEPS $RUN_DEPS
RUN curl -sSL https://downloads.powerdns.com/releases/pdns-$POWERDNS_VERSION.tar.bz2 | tar xj -C /tmp/
WORKDIR /tmp/pdns-$POWERDNS_VERSION
RUN ./configure --prefix="" --exec-prefix=/usr --sysconfdir=/etc/pdns --with-modules="$POWERDNS_MODULES"
RUN make
RUN DESTDIR="/pdnsbuild" make install-strip
RUN mkdir -p /pdnsbuild/etc/pdns/conf.d /pdnsbuild/etc/pdns/sql
RUN cp modules/gmysqlbackend/*.sql modules/gpgsqlbackend/*.sql modules/gsqlite3backend/*.sql /pdnsbuild/etc/pdns/sql/
FROM base
COPY --from=build /pdnsbuild /
RUN apk add $RUN_DEPS && \
addgroup -S pdns 2>/dev/null && \
adduser -S -D -H -h /var/empty -s /bin/false -G pdns -g pdns pdns 2>/dev/null && \
rm /var/cache/apk/*
LABEL \
MAINTAINER="Antoine Millet <antoine@inaps.org>" \
CONTRIBUTORS="Christoph Wiechert <wio@psitrax.de>, Mathias Kaufmann <me@stei.gr>, Cloudesire <cloduesire-dev@eng.it>"
ENV AUTOCONF=mysql \
AUTO_SCHEMA_MIGRATION="yes" \
MYSQL_HOST="mysql" \
MYSQL_PORT="3306" \
MYSQL_USER="root" \
MYSQL_PASS="root" \
MYSQL_DB="pdns" \
MYSQL_DNSSEC="no" \
MYSQL_VERSION="4.3.0" \
PGSQL_HOST="postgres" \
PGSQL_PORT="5432" \
PGSQL_USER="postgres" \
PGSQL_PASS="postgres" \
PGSQL_DB="pdns" \
PGSQL_VERSION="4.3.0" \
SQLITE_DB="pdns.sqlite3" \
SQLITE_VERSION="4.3.1" \
SCHEMA_VERSION_TABLE="_schema_version"
EXPOSE 53/tcp 53/udp
ADD pdns.conf /etc/pdns/
ADD entrypoint.sh /bin/powerdns
ENTRYPOINT ["powerdns"]