move configs in contrib to conf
[oweals/gnunet.git] / contrib / docker / Dockerfile
1 FROM ubuntu:18.04
2
3 ENV DEBIAN_FRONTEND noninteractive
4
5 # Install tools and dependencies
6 RUN apt-get update && \
7     apt-get -y install --no-install-recommends \
8       ca-certificates \
9       libsasl2-modules \
10       git \
11       automake \
12       autopoint \
13       autoconf \
14       texinfo \
15       libtool \
16       libltdl-dev \
17       libgpg-error-dev \
18       libidn11-dev \
19       libunistring-dev \
20       libglpk-dev \
21       libbluetooth-dev \
22       libextractor-dev \
23       libmicrohttpd-dev \
24       libgnutls28-dev \
25       libgcrypt20-dev \
26       libpq-dev \
27       libsqlite3-dev \
28       wget && \
29     apt-get clean all && \
30     apt-get -y autoremove && \
31     rm -rf \
32       /var/lib/apt/lists/* \
33       /tmp/*
34
35 # Install GNUrl
36 ENV GNURL_VERSION=7.57.0
37
38 RUN wget -O /tmp/gnurl.tar.xz https://ftpmirror.gnu.org/gnu/gnunet/gnurl-${GNURL_VERSION}.tar.xz
39 RUN cd /tmp && \
40       tar xvf gnurl.tar.xz && \
41       cd gnurl-${GNURL_VERSION} && \
42       autoreconf -i && \
43       ./configure \
44         --enable-ipv6 \
45         --with-gnutls \
46         --without-libssh2 \
47         --without-libmetalink \
48         --without-winidn \
49         --without-librtmp \
50         --without-nghttp2 \
51         --without-nss \
52         --without-cyassl \
53         --without-polarssl \
54         --without-ssl \
55         --without-winssl \
56         --without-darwinssl \
57         --disable-sspi \
58         --disable-ntlm-wb \
59         --disable-ldap \
60         --disable-rtsp \
61         --disable-dict \
62         --disable-telnet \
63         --disable-tftp \
64         --disable-pop3 \
65         --disable-imap \
66         --disable-smtp \
67         --disable-gopher \
68         --disable-file \
69         --disable-ftp \
70         --disable-smb && \
71       make install && \
72     cd - && \
73     rm -rf /tmp/gnurl*
74
75 # Install GNUnet
76 ENV GNUNET_PREFIX /usr/local/gnunet
77 ENV CFLAGS '-g -Wall -O0'
78
79 COPY . /gnunet
80
81 RUN cd /gnunet && \
82       ./bootstrap && \
83       ./configure \
84         --with-nssdir=/lib \
85         --prefix="$GNUNET_PREFIX" \
86         --enable-logging=verbose && \
87       make -j3 && \
88       make install && \
89       ldconfig && \
90     cd - && \
91     rm -fr /gnunet
92
93 # Configure GNUnet
94 COPY ./contrib/docker/gnunet.conf /etc/gnunet.conf
95 COPY ./contrib/docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
96 RUN chmod 755 /usr/local/bin/docker-entrypoint
97
98 ENV LOCAL_PORT_RANGE='40001 40200'
99 ENV PATH "$GNUNET_PREFIX/bin:/usr/local/bin:$PATH"
100
101 ENTRYPOINT ["docker-entrypoint"]