Dockerfile 910 Bytes
Newer Older
1
FROM alpine:edge
2 3
MAINTAINER Marek Vavrusa <marek.vavrusa@nic.cz>

4
# Environment
5 6 7 8
ENV BUILD_PKGS build-base automake autoconf libtool pkgconfig git luajit-dev libuv-dev gnutls-dev jansson-dev userspace-rcu-dev
ENV RUN_PKGS luajit libuv gnutls jansson bash
ENV BUILD_IGNORE gmp nettle jansson gnutls lua libuv cmocka
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
9
ENV CFLAGS -O2 -ftree-vectorize -fstack-protector -g
10
ENV LDFLAGS -Wl,--as-needed
11

12 13
# Expose port
EXPOSE 53
14 15

# Select entrypoint
16
WORKDIR /data
17
CMD ["/usr/local/sbin/kresd"]
18

19
# Install dependencies and sources
20 21 22 23 24 25 26
RUN \
apk --update add ${RUN_PKGS} && \
apk add --virtual build-dep ${BUILD_PKGS} && \
git clone https://gitlab.labs.nic.cz/knot/resolver.git /tmp/build && \
cd /tmp/build && \
./scripts/bootstrap-depends.sh /usr/local && \
make -j4 install && \
27
# Trim down the image
28 29 30
cd / && \
apk del --purge build-dep && \
rm -rf /var/cache/apk/* /tmp/build