-from fedora:26
-
-# Install the required build tools
-RUN dnf -y update && dnf -y install which git automake texinfo gettext-devel autoconf libtool libtool-ltdl-devel libidn-devel libunistring-devel glpk libextractor-devel libmicrohttpd-devel gnutls libgcrypt-devel jansson-devel sqlite-devel npm
-
-WORKDIR /usr/src
-
-# Install gnurl from source at version gnurl-7.54.0
-RUN git clone https://git.taler.net/gnurl.git --branch gnurl-7.54.0
-WORKDIR /usr/src/gnurl
-RUN autoreconf -i
-RUN ./configure --enable-ipv6 --with-gnutls --without-libssh2 \
---without-libmetalink --without-winidn --without-librtmp \
---without-nghttp2 --without-nss --without-cyassl \
---without-polarssl --without-ssl --without-winssl \
---without-darwinssl --disable-sspi --disable-ntlm-wb --disable-ldap \
---disable-rtsp --disable-dict --disable-telnet --disable-tftp \
---disable-pop3 --disable-imap --disable-smtp --disable-gopher \
---disable-file --disable-ftp --disable-smb
-RUN make install
-WORKDIR /usr/src
-
-RUN dnf -y install wget flex bison
-
-# Install libpbc
-RUN wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz
-RUN tar xvzpf pbc-0.5.14.tar.gz
-WORKDIR /usr/src/pbc-0.5.14
-RUN ./configure --prefix=/usr
-RUN make install
-WORKDIR /usr/src
-
-RUN dnf -y install glib2-devel
-
-# Install libbswabe
-RUN git clone https://github.com/schanzen/libgabe.git
-WORKDIR /usr/src/libgabe
-RUN ./configure --prefix=/usr
-RUN make install
-
-# Install WebUI
-WORKDIR /usr/src/
-RUN git clone https://github.com/schanzen/gnunet-webui.git
-WORKDIR /usr/src/gnunet-webui
-RUN git checkout gnuidentity
-
-RUN ./bootstrap
-RUN ./configure --prefix=/usr/local
-RUN make
-RUN make install
-
-RUN groupadd gnunetdns
-RUN adduser --system -m --home-dir /var/lib/gnunet gnunet
-RUN chown gnunet:gnunet /var/lib/gnunet
-RUN echo '[arm]\nSYSTEM_ONLY = YES\nUSER_ONLY = NO\n' > /etc/gnunet.conf
+FROM ubuntu:18.04
+
+ENV DEBIAN_FRONTEND noninteractive
+
+# Install tools and dependencies
+RUN apt-get update && \
+ apt-get -y install --no-install-recommends \
+ ca-certificates \
+ libsasl2-modules \
+ git \
+ automake \
+ autopoint \
+ autoconf \
+ texinfo \
+ libtool \
+ libltdl-dev \
+ libgpg-error-dev \
+ libidn11-dev \
+ libunistring-dev \
+ libglpk-dev \
+ libbluetooth-dev \
+ libextractor-dev \
+ libmicrohttpd-dev \
+ libgnutls28-dev \
+ libgcrypt20-dev \
+ libpq-dev \
+ libsqlite3-dev && \
+ apt-get clean all && \
+ apt-get -y autoremove && \
+ rm -rf \
+ /var/lib/apt/lists/* \
+ /tmp/*
+
+# Install GNUrl
+ENV GNURL_GIT_URL https://git.taler.net/gnurl.git
+ENV GNURL_GIT_BRANCH gnurl-7.57.0
+
+RUN git clone $GNURL_GIT_URL \
+ --branch $GNURL_GIT_BRANCH \
+ --depth=1 \
+ --quiet && \
+ cd /gnurl && \
+ autoreconf -i && \
+ ./configure \
+ --enable-ipv6 \
+ --with-gnutls \
+ --without-libssh2 \
+ --without-libmetalink \
+ --without-winidn \
+ --without-librtmp \
+ --without-nghttp2 \
+ --without-nss \
+ --without-cyassl \
+ --without-polarssl \
+ --without-ssl \
+ --without-winssl \
+ --without-darwinssl \
+ --disable-sspi \
+ --disable-ntlm-wb \
+ --disable-ldap \
+ --disable-rtsp \
+ --disable-dict \
+ --disable-telnet \
+ --disable-tftp \
+ --disable-pop3 \
+ --disable-imap \
+ --disable-smtp \
+ --disable-gopher \
+ --disable-file \
+ --disable-ftp \
+ --disable-smb && \
+ make install && \
+ cd - && \
+ rm -fr /gnurl
+
+# Install GNUnet
+ENV GNUNET_PREFIX /usr/local/gnunet
+ENV CFLAGS '-g -Wall -O0'
+
+COPY . /gnunet
+
+RUN cd /gnunet && \
+ ./bootstrap && \
+ ./configure \
+ --with-nssdir=/lib \
+ --prefix="$GNUNET_PREFIX" \
+ --enable-logging=verbose && \
+ make -j3 && \
+ make install && \
+ ldconfig && \
+ cd - && \
+ rm -fr /gnunet
+
+# Configure GNUnet
+COPY docker/gnunet.conf /etc/gnunet.conf
+COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
+RUN chmod 755 /usr/local/bin/docker-entrypoint
+
+ENV LOCAL_PORT_RANGE='40001 40200'
+ENV PATH "$GNUNET_PREFIX/bin:/usr/local/bin:$PATH"
+
+ENTRYPOINT ["docker-entrypoint"]