forked from abracadaniel/cardano-pool-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.node
69 lines (60 loc) · 2.47 KB
/
Dockerfile.node
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
FROM debian:buster-slim as build
# Install build dependencies
RUN apt-get update -y \
&& apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf liblmdb-dev -y \
&& apt-get install -y libsqlite3-dev m4 ca-certificates gcc libc6-dev curl \
&& apt-get clean
# Install GHC
ENV CABAL_VERSION=3.6.2.0 \
GHC_VERSION=8.10.7 \
PATH="$HOME/.cabal/bin:/root/.ghcup/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh \
&& ghcup install ghc ${GHC_VERSION} \
&& ghcup install cabal ${CABAL_VERSION} \
&& ghcup set ghc ${GHC_VERSION} \
&& ghcup set cabal ${CABAL_VERSION}
# Install libsodium
ARG LIBSODIUM_VERSION
RUN git clone https://github.com/input-output-hk/libsodium \
&& cd libsodium \
&& git fetch --all --recurse-submodules --tags \
&& git tag \
&& git checkout $LIBSODIUM_VERSION \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install \
&& cd .. && rm -rf libsodium
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
# Install Secp256k1
RUN git clone https://github.com/bitcoin-core/secp256k1 \
&& cd secp256k1 \
&& git checkout ac83be33 \
&& ./autogen.sh \
&& ./configure --enable-module-schnorrsig --enable-experimental \
&& make && make install
# Install cardano-node
ARG VERSION
RUN echo "Building tags/${VERSION}..." \
&& echo tags/${VERSION} > /CARDANO_BRANCH \
&& git clone https://github.com/input-output-hk/cardano-node.git \
&& cd cardano-node \
&& git fetch --all --recurse-submodules --tags \
&& git tag \
&& git checkout tags/${VERSION} \
&& echo "with-compiler: ghc-${GHC_VERSION}" >> cabal.project.local \
&& echo "package cardano-crypto-praos" >> cabal.project.local \
&& echo " flags: -external-libsodium-vrf" >> cabal.project.local \
&& cabal update \
&& cabal build all \
&& mkdir -p /root/.local/bin/ \
&& cp -p "$(./scripts/bin-path.sh cardano-node)" /root/.local/bin/ \
&& cp -p "$(./scripts/bin-path.sh cardano-cli)" /root/.local/bin/ \
&& cd .. && rm -rf cardano-node
# Run
FROM debian:stable-slim
COPY --from=build /root/.local/bin/ /bin/
COPY --from=build /usr/local/lib/ /lib/
SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["cardano-node"]