Commit 2ee3e600 authored by Marek Vavruša's avatar Marek Vavruša

docker: trimmed down production image

parent 1625a051
FROM debian:jessie
MAINTAINER Marek Vavrusa <marek.vavrusa@nic.cz>
# Nprocs
ENV THREADS 4
# Install dependencies and sources
RUN apt-get -y update; \
apt-get install -y \
build-essential \
git-core \
libtool \
autoconf \
flex \
bison \
libssl-dev \
liburcu-dev \
pkg-config \
liblmdb-dev; \
# Trim down the image
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
# Fetch and compile sources
RUN mkdir /src; \
git clone https://gitlab.labs.nic.cz/labs/knot.git /src/knot; \
cd /src/knot && autoreconf -if && ./configure && make -j${THREADS} && make install && ldconfig; \
# Trim down the image
rm -rf /src
# Select entrypoint
WORKDIR /root
CMD ["/usr/local/sbin/knotd"]
# Expose port
EXPOSE 53
# Environment
ENV THREADS 4
ENV BUILD_PKGS git-core make gcc libtool autoconf pkg-config flex bison libssl-dev liburcu-dev liblmdb-dev
ENV RUNTIME_PKGS libssl1.0.0 liburcu2 liblmdb0
# Install dependencies and sources
RUN apt-get -q -y update && \
apt-get install -q -y ${BUILD_PKGS} ${RUNTIME_PKGS} && \
# Compile sources
git clone -b master https://gitlab.labs.nic.cz/labs/knot.git /knot-src && \
cd /knot-src && \
autoreconf -if && \
./configure --disable-static && \
make -j${THREADS} && \
make check && \
make install && \
ldconfig && \
# Trim down the image
cd && \
rm -rf /knot-src && \
apt-get purge -q -y ${BUILD_PKGS} && \
apt-get autoremove -q -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment