Skip to content

Commit 212e04d

Browse files
form code
1 parent d9f94e8 commit 212e04d

File tree

2 files changed

+74
-85
lines changed

2 files changed

+74
-85
lines changed

Dockerfile

+72-83
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,74 @@ FROM alpine:3.17.1 as builder
22

33
ENV POWERDNS_VER=4.7.3
44

5-
# Install libs we need
65
RUN set -eux; \
7-
true "Installing build dependencies"; \
86
apk add --no-cache \
9-
build-base \
10-
\
11-
boost-dev curl curl-dev geoip-dev krb5-dev openssl-dev \
12-
libsodium-dev lua-dev mariadb-connector-c-dev \
13-
protobuf-dev yaml-cpp-dev zeromq-dev mariadb-dev luajit-dev \
14-
libmaxminddb-dev
15-
16-
# Download packages
7+
build-base \
8+
\
9+
boost-dev curl curl-dev geoip-dev krb5-dev openssl-dev \
10+
libsodium-dev lua-dev mariadb-connector-c-dev \
11+
protobuf-dev yaml-cpp-dev zeromq-dev mariadb-dev luajit-dev \
12+
libmaxminddb-dev
13+
1714
RUN set -eux; \
1815
mkdir -p build; \
1916
cd build; \
2017
wget "https://downloads.powerdns.com/releases/pdns-${POWERDNS_VER}.tar.bz2"; \
2118
tar -jxf "pdns-${POWERDNS_VER}.tar.bz2"
2219

23-
24-
# Build and install PowerDNS
2520
RUN set -eux; \
2621
cd build; \
2722
cd "pdns-${POWERDNS_VER}"; \
28-
# Compiler flags
2923
export CFLAGS="-march=x86-64 -mtune=generic -Os -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto"; \
3024
export CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS"; \
3125
export LDFLAGS="-Wl,-Os,--sort-common,--as-needed,-z,relro,-z,now -flto=auto"; \
3226
\
3327
./configure \
34-
--prefix=/usr \
35-
--sysconfdir="/etc/powerdns" \
36-
--sbindir=/usr/sbin \
37-
--mandir=/usr/share/man \
38-
--infodir=/usr/share/info \
39-
--localstatedir=/var \
40-
--libdir="/usr/lib/powerdns" \
41-
--disable-static \
42-
--with-modules="" \
43-
--with-dynmodules="bind geoip gmysql lua2 pipe remote" \
44-
--with-libsodium \
45-
--enable-tools \
46-
--enable-ixfrdist \
47-
--enable-dns-over-tls \
48-
--disable-dependency-tracking \
49-
--disable-silent-rules \
50-
--enable-reproducible \
51-
--enable-unit-tests \
52-
--with-service-user=powerdns \
53-
--with-service-group=powerdns \
54-
--enable-remotebackend-zeromq; \
28+
--prefix=/usr \
29+
--sysconfdir="/etc/powerdns" \
30+
--sbindir=/usr/sbin \
31+
--mandir=/usr/share/man \
32+
--infodir=/usr/share/info \
33+
--localstatedir=/var \
34+
--libdir="/usr/lib/powerdns" \
35+
--disable-static \
36+
--with-modules="" \
37+
--with-dynmodules="bind geoip gmysql lua2 pipe remote" \
38+
--with-libsodium \
39+
--enable-tools \
40+
--enable-ixfrdist \
41+
--enable-dns-over-tls \
42+
--disable-dependency-tracking \
43+
--disable-silent-rules \
44+
--enable-reproducible \
45+
--enable-unit-tests \
46+
--with-service-user=powerdns \
47+
--with-service-group=powerdns \
48+
--enable-remotebackend-zeromq; \
5549
make V=1 -j$(nproc) -l8 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS"; \
5650
\
5751
pkgdir=/build/powerdns-root; \
5852
make DESTDIR="$pkgdir" install; \
5953
\
60-
# Move some things around
6154
mv "$pkgdir"/etc/powerdns/pdns.conf-dist "$pkgdir"/etc/powerdns/pdns.conf; \
6255
mv "$pkgdir"/etc/powerdns/ixfrdist.example.yml "$pkgdir"/usr/share/doc/pdns/; \
63-
# Remove cruft
6456
find "$pkgdir" -type f -name "*.a" -o -name "*.la" | xargs rm -fv; \
6557
rm -rfv \
66-
"$pkgdir"/usr/include \
67-
"$pkgdir"/usr/share/man
68-
58+
"$pkgdir"/usr/include \
59+
"$pkgdir"/usr/share/man
6960

7061
RUN set -eux; \
7162
cd build/powerdns-root; \
7263
scanelf --recursive --nobanner --osabi --etype "ET_DYN,ET_EXEC" . | awk '{print $3}' | xargs \
73-
strip \
74-
--remove-section=.comment \
75-
--remove-section=.note \
76-
-R .gnu.lto_* -R .gnu.debuglto_* \
77-
-N __gnu_lto_slim -N __gnu_lto_v1 \
78-
--strip-unneeded
79-
80-
#
81-
# Build final image
82-
#
64+
strip \
65+
--remove-section=.comment \
66+
--remove-section=.note \
67+
-R .gnu.lto_* -R .gnu.debuglto_* \
68+
-N __gnu_lto_slim -N __gnu_lto_v1 \
69+
--strip-unneeded
70+
71+
72+
8373
FROM alpine:3.17.1
8474

8575
ENV POWERADMIN_VER=3.4.2
@@ -93,38 +83,37 @@ ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
9383
RUN set -eux; \
9484
true "PowerDNS and PowerAdmin requirements"; \
9585
apk add --no-cache \
96-
boost-libs \
97-
geoip \
98-
libcurl \
99-
libmaxminddb-libs \
100-
luajit \
101-
mariadb-client \
102-
mariadb-connector-c \
103-
yaml-cpp \
104-
zeromq \
105-
openssl \
106-
\
107-
pwgen \
108-
supervisor \
109-
nginx \
110-
php81 \
111-
php81-fpm \
112-
php81-intl \
113-
php81-iconv \
114-
php81-mysqlnd \
115-
php81-pdo \
116-
php81-pdo_mysql \
117-
php81-gettext \
118-
php81-openssl \
119-
php81-session \
120-
php81-tokenizer \
121-
php81-mbstring \
122-
php81-xml \
123-
\
124-
composer musl musl-utils musl-locales tzdata \
125-
#bind-tools; \
126-
rm -f /var/cache/apk/*; \
127-
rm -rf /var/www/localhost
86+
boost-libs \
87+
geoip \
88+
libcurl \
89+
libmaxminddb-libs \
90+
luajit \
91+
mariadb-client \
92+
mariadb-connector-c \
93+
yaml-cpp \
94+
zeromq \
95+
openssl \
96+
\
97+
pwgen \
98+
supervisor \
99+
nginx \
100+
php81 \
101+
php81-fpm \
102+
php81-intl \
103+
php81-iconv \
104+
php81-mysqlnd \
105+
php81-pdo \
106+
php81-pdo_mysql \
107+
php81-gettext \
108+
php81-openssl \
109+
php81-session \
110+
php81-tokenizer \
111+
php81-mbstring \
112+
php81-xml \
113+
\
114+
composer musl musl-utils musl-locales tzdata \
115+
#bind-tools; \
116+
rm -f /var/cache/apk/*
128117

129118
RUN set -eux; \
130119
mkdir -p /var/www/html; \
@@ -151,9 +140,9 @@ RUN set -eux; \
151140
chmod +x /usr/bin/entrypoint; \
152141
mkdir -p /run/powerdns; \
153142
chmod 0750 /etc/powerdns; \
154-
chmod 0640 /etc/powerdns/pdns.conf; \
143+
chmod 0640 /etc/powerdns/pdns.conf; \
155144
chmod 0755 /run/powerdns; \
156-
chown -R root:powerdns /etc/powerdns; \
145+
chown -R root:powerdns /etc/powerdns; \
157146
chown -R nginx:nginx /var/www/html; \
158147
chown -R powerdns:powerdns /run/powerdns
159148

poweradmin/config.inc.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$session_key = 'POWERADMIN_SESSION_KEY';
99

1010
$iface_lang = 'POWERADMIN_IFACE_LANG';
11-
$iface_style = 'ignite';
11+
$iface_style = 'ignite';
1212

1313
$dns_hostmaster = 'POWERADMIN_HOSTMASTER';
1414
$dns_ns1 = 'POWERADMIN_NS1';
@@ -20,4 +20,4 @@
2020
$pdnssec_debug = false;
2121
$pdnssec_command = '/usr/bin/pdnsutil';
2222

23-
$ignore_install_dir = true;
23+
$ignore_install_dir = true;

0 commit comments

Comments
 (0)