Commit 41dcd3ed authored by Marek Vavruša's avatar Marek Vavruša

build: updated dockerfile, added BUILD_IGNORE for depends

parent 27878393
......@@ -70,6 +70,7 @@ ifeq ($$(strip $$($(1)_LIBS)),)
else
HAS_$(1) := yes
$(1):
.PHONY: $(1)
endif
endef
......
FROM cznic/knot:latest
FROM debian:jessie
MAINTAINER Marek Vavrusa <marek.vavrusa@nic.cz>
# Environment
ENV THREADS 4
ENV BUILD_PKGS git-core make gcc libtool autoconf pkg-config libcmocka-dev libgnutls28-dev liblmdb-dev libjansson-dev
ENV RUNTIME_PKGS libgnutls28 libjansson liblmdb0
ENV BUILD_PKGS git-core make gcc libtool autoconf pkg-config cmake libgnutls28-dev libjansson-dev
ENV RUN_PKGS libgnutls-deb0-28 libjansson4
ENV PREFIX /usr/local
ENV BUILD_DIR /tmp/build
ENV BUILD_IGNORE gmp nettle jansson gnutls
# Expose port
EXPOSE 53
......@@ -15,28 +18,18 @@ CMD ["/usr/local/sbin/kresolved", "-a", "0.0.0.0#53"]
# Install dependencies and sources
RUN apt-get -q -y update && \
apt-get install -q -y ${BUILD_PKGS} ${RUNTIME_PKGS} && \
# Install libuv
git clone https://github.com/libuv/libuv.git /libuv-src && \
cd /libuv-src && \
sh autogen.sh && \
./configure && \
make -j${THREADS} && \
make install && \
apt-get install -q -y ${BUILD_PKGS} ${RUN_PKGS} && \
# Install dependencies
git clone https://gitlab.labs.nic.cz/knot/resolver.git ${BUILD_DIR} && \
cd ${BUILD_DIR} && \
./scripts/bootstrap-depends.sh ${PREFIX} && \
ldconfig && \
# Install knot-resolver
git clone https://gitlab.labs.nic.cz/knot/resolver.git /resolver-src && \
cd /resolver-src && \
sh ./bootstrap && \
./configure && \
make -j${THREADS} && \
make check && \
make install && \
ldconfig && \
# Trim down the image
rm -rf /libuv-src && \
rm -rf /resolver-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/*
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
......@@ -45,7 +45,7 @@ function fetch_pkg {
function build_pkg {
if [ -f CMakeLists.txt ]; then
[ -e cmake-build ] && rm -r cmake-build; mkdir cmake-build; cd cmake-build
[ -e cmake-build ] && rm -rf cmake-build; mkdir cmake-build; cd cmake-build
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
else
if [ ! -e ./configure ]; then
......@@ -58,7 +58,7 @@ function build_pkg {
}
function pkg {
if [ ! -e ${PREFIX}/$4 ]; then
if [ ! -e ${PREFIX}/$4 ] && [ "${BUILD_IGNORE}" == "${BUILD_IGNORE/$1/}" ] ; then
cd ${BUILD_DIR}
echo "[x] fetching $1-$3"
fetch_pkg "$1-$3" "$2" $3 >> ${LOG}
......@@ -99,3 +99,6 @@ pkg libknot ${KNOT_URL} ${KNOT_TAG} include/libknot \
pkg cmocka ${CMOCKA_URL} ${CMOCKA_TAG} include/cmocka.h
# libuv
pkg libuv ${LIBUV_URL} ${LIBUV_TAG} include/uv.h --disable-static
# remove on successful build
rm -rf ${BUILD_DIR}
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