summaryrefslogtreecommitdiff
path: root/docker/demo/images/base/Dockerfile
blob: 4997796d1db74560282a8f5d3fc8bf0f2102b796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
FROM debian:stable
RUN apt-get update

RUN apt-get install -y autoconf autopoint libtool texinfo \
  libgcrypt-dev libidn11-dev zlib1g-dev libunistring-dev \
  libjansson-dev python3-pip git recutils libsqlite3-dev \
  libpq-dev postgresql libcurl4-openssl-dev libsodium-dev git \
  libqrencode-dev zip jq npm openjdk-17-jre nginx procps \
  curl python3-jinja2 wget curl python3-sphinx socat apache2-utils \
  python3-sphinx-rtd-theme sqlite3
RUN pip3 install requests click poetry uwsgi htmlark

ARG tags_file
# The following command provides a conditional copy from
# the host filesystem.  It mounts the current directory -
# where the tags file MIGHT be - to /context in the container.
# It appears NOT possible to mount arbitrary paths from the
# host with "RUN --mount".  Hence, when a tags file is given,
# the CWD has to be the one containing the tags file.  build_base.sh
# sets (1) the CWD this way and (2) $tags_file to be the tags file
# basename, before starting the compilation.
RUN --mount=target=/context if test -n "$tags_file"; then cp \
/context/${tags_file} /tags.sh; else touch /tags.sh; fi

RUN . /tags.sh && git clone git://git.gnunet.org/libmicrohttpd \
  --branch ${TAG_LIBMHD:-master}
RUN . /tags.sh && git clone git://git.gnunet.org/gnunet \
  --branch ${TAG_GNUNET:-master}
RUN . /tags.sh && git clone git://git.taler.net/exchange \
  --branch ${TAG_EXCHANGE:-master}
RUN . /tags.sh && git clone git://git.taler.net/merchant \
  --branch ${TAG_MERCHANT:-master}
RUN . /tags.sh && git clone git://git.taler.net/libeufin \
  --branch ${TAG_LIBEUFIN:-master}
RUN . /tags.sh && git clone git://git.taler.net/taler-merchant-demos \
  --branch ${TAG_MERCHANT_DEMOS:-master}
RUN . /tags.sh && git clone git://git.taler.net/wallet-core \
  --branch ${TAG_WALLET:-master}
RUN . /tags.sh && git clone git://git.taler.net/sync \
  --branch ${TAG_SYNC:-master}

WORKDIR /libmicrohttpd
RUN ./bootstrap
RUN ./configure --disable-doc
RUN make install

WORKDIR /gnunet
RUN ./bootstrap
RUN ./configure --enable-logging=verbose --disable-documentation
RUN make install

WORKDIR /exchange
RUN if . /tags.sh && test "${TAG_EXCHANGE:-}" = "v0.9.0"; then \
  # Init Gana and checkout the v0.9.0-compatible commit.
  git submodule init contrib/gana; \
  git submodule update --remote contrib/gana; \
  # Note: without init first, the following checkout hits "reference is not a tree".
  git -C contrib/gana checkout 6b9824cb4d4561f1167c7f518998a226a82222d6; \
  # Remove master branch tracking the remote
  git -C contrib/gana branch -d master; \
  git -C contrib/gana remote set-url origin .; \
  git -C contrib/gana branch master; \
fi
RUN ./bootstrap
RUN ./configure CFLAGS="-ggdb -O0" --enable-logging=verbose --disable-doc
RUN make install

WORKDIR /merchant
RUN ./bootstrap
RUN ./configure CFLAGS="-ggdb -O0" \
  --enable-logging=verbose \
  --disable-doc
RUN make install

WORKDIR /libeufin
RUN ./bootstrap
RUN ./configure
RUN make install

WORKDIR /taler-merchant-demos
RUN ./bootstrap
RUN ./configure
RUN make install

# From: https://github.com/nodesource/distributions/blob/master/README.md#debinstall
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get install -y nodejs
RUN npm install -g pnpm

WORKDIR /wallet-core
RUN ./bootstrap
WORKDIR ./packages/demobank-ui
RUN ./configure
RUN make install
# Install CLI to provide integration tests.
WORKDIR ../taler-wallet-cli
RUN ./configure
RUN make install

WORKDIR /sync
RUN ./bootstrap
RUN ./configure CFLAGS="-ggdb -O0" \
  --enable-logging=verbose \
  --disable-doc
RUN make install

WORKDIR /