-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.src-build
33 lines (28 loc) · 1.35 KB
/
Dockerfile.src-build
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
ARG CARDANO_NODE_COMMIT=master
FROM repsistance/cardano-node:src-${CARDANO_NODE_COMMIT} AS src
FROM ubuntu:20.04 AS src-build
ENV CARDANO_NODE_COMMIT ${CARDANO_NODE_COMMIT}
ARG CABAL_TARGETS="cardano-node cardano-cli"
ARG STACK_URL="https://www.stackage.org/stack/linux-x86_64"
ENV STACK_URL ${STACK_URL}
WORKDIR /src
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg build-essential pkg-config ghc cabal-install git libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev libsodium-dev pkg-config && \
curl -sLo /tmp/stack.tgz ${STACK_URL} && \
tar -zxf /tmp/stack.tgz -C /tmp && \
mv /tmp/stack-*/stack /usr/local/bin && \
chmod +x /usr/local/bin/stack
COPY ./assets/cardano-node-patches /patches
COPY --from=src /src /src
RUN echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local && \
for patch in /patches/*; do patch -p0 < ${patch}; done && \
stack build --test --no-run-tests --copy-bins --local-bin-path /output
# cabal update && \
# for target in ${CABAL_TARGETS}; do cabal new-build ${target}; done
#
## TODO: there is probably a better way to extract/install binaries
#RUN mkdir /output && \
# find dist-newstyle/build -type f -executable | grep -v ".so$" | while read bin; \
# do \
# cp -a ${PWD}/$bin /output; \
# done