forked from CZ-NIC/knot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (64 loc) · 1.48 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## Intermediate stage ##
FROM debian:stable-slim
# Environment
ENV BUILD_PKGS \
autoconf \
automake \
gcc \
git-core \
libedit-dev \
libfstrm-dev \
libgnutls28-dev \
libidn2-0-dev \
liblmdb-dev \
libmaxminddb-dev \
libprotobuf-c-dev \
libtool \
liburcu-dev \
make \
pkg-config \
protobuf-c-compiler
# Install dependencies
RUN apt-get update && \
apt-get install -yqq ${BUILD_PKGS}
# Build the project
COPY . /knot-src
WORKDIR /knot-src
RUN autoreconf -if && \
./configure --prefix=/ \
--with-rundir=/rundir \
--with-storage=/storage \
--with-configdir=/config \
--with-module-dnstap=yes \
--disable-fastparser \
--disable-static \
--disable-documentation && \
make -j$(grep -c ^processor /proc/cpuinfo) && \
make install DESTDIR=/tmp/knot-install
## Final stage ##
FROM debian:stable-slim
MAINTAINER Knot DNS <[email protected]>
# Environment
ENV RUNTIME_PKGS \
libedit2 \
libfstrm0 \
libgnutls30 \
libidn2-0 \
liblmdb0 \
libmaxminddb0 \
libprotobuf-c1 \
liburcu6
# Copy artifacts
COPY --from=0 /tmp/knot-install/ /
# Install dependencies
RUN apt-get update && \
apt-get install -yqq ${RUNTIME_PKGS} && \
rm -rf /var/lib/apt/lists/* && \
ldconfig
# Expose port
EXPOSE 53/UDP
EXPOSE 53/TCP
# Prepare shared directories
VOLUME /config
VOLUME /rundir
VOLUME /storage