|
| 1 | +ARG UBUNTU_VERSION=20.04 |
| 2 | +FROM ubuntu:${UBUNTU_VERSION} |
| 3 | +ENV DEBIAN_FRONTEND=nonintercative |
| 4 | +RUN mkdir -p /app/src |
| 5 | +WORKDIR /app |
| 6 | + |
| 7 | +# development dependencies |
| 8 | +RUN apt-get update -y && apt-get install -y \ |
| 9 | + curl \ |
| 10 | + xz-utils \ |
| 11 | + automake \ |
| 12 | + build-essential \ |
| 13 | + g++\ |
| 14 | + git \ |
| 15 | + jq \ |
| 16 | + libicu-dev \ |
| 17 | + libffi-dev \ |
| 18 | + libgmp-dev \ |
| 19 | + libncursesw5 \ |
| 20 | + libpq-dev \ |
| 21 | + libssl-dev \ |
| 22 | + libsystemd-dev \ |
| 23 | + libtinfo-dev \ |
| 24 | + libtool \ |
| 25 | + make \ |
| 26 | + pkg-config \ |
| 27 | + tmux \ |
| 28 | + wget \ |
| 29 | + zlib1g-dev libreadline-dev llvm libnuma-dev \ |
| 30 | + && rm -rf /var/lib/apt/lists/* |
| 31 | + |
| 32 | +ARG CABAL_VERSION=3.6.2.0 |
| 33 | +ARG GHC_VERSION=8.10.7 |
| 34 | +ARG HLS_VERSION=1.7.0.0 |
| 35 | +ARG IOHK_LIBSODIUM_GIT_REV=66f017f16633f2060db25e17c170c2afa0f2a8a1 |
| 36 | +ARG IOKH_LIBSECP251_GIT_REV=ac83be33d0956faf6b7f61a60ab524ef7d6a473a |
| 37 | + |
| 38 | +# install secp2561k library with prefix '/' |
| 39 | +RUN git clone https://github.com/bitcoin-core/secp256k1 &&\ |
| 40 | + cd secp256k1 \ |
| 41 | + && git fetch --all --tags &&\ |
| 42 | + git checkout ${IOKH_LIBSECP251_GIT_REV} \ |
| 43 | + && ./autogen.sh && \ |
| 44 | + ./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental && \ |
| 45 | + make && \ |
| 46 | + make install && cd .. && rm -rf ./secp256k1 |
| 47 | + |
| 48 | + |
| 49 | +# install libsodium from sources with prefix '/' |
| 50 | +RUN git clone https://github.com/input-output-hk/libsodium.git &&\ |
| 51 | + cd libsodium \ |
| 52 | + && git fetch --all --tags &&\ |
| 53 | + git checkout ${IOHK_LIBSODIUM_GIT_REV} \ |
| 54 | + && ./autogen.sh && \ |
| 55 | + ./configure --prefix=/usr && \ |
| 56 | + make && \ |
| 57 | + make install && cd .. && rm -rf ./libsodium |
| 58 | + |
| 59 | + |
| 60 | +# install ghcup |
| 61 | +ENV PATH=${PATH}:${HOME:-/root}/.ghcup/bin |
| 62 | +RUN wget --secure-protocol=TLSv1_2 \ |
| 63 | + https://downloads.haskell.org/~ghcup/$(arch)-linux-ghcup \ |
| 64 | + && chmod +x $(arch)-linux-ghcup \ |
| 65 | + && mkdir -p ${HOME:-/root}/.ghcup/bin \ |
| 66 | + && mv $(arch)-linux-ghcup ${HOME:-/root}/.ghcup/bin/ghcup |
| 67 | + |
| 68 | +# RUN ghcup config set downloader Wget \ |
| 69 | +# && ghcup install ghc ${GHC_VERSION} \ |
| 70 | +# && ghcup install cabal ${CABAL_VERSION} \ |
| 71 | +# && ghcup set ghc |
| 72 | +# RUN ghcup install hls ${HLS_VERSION} |
| 73 | + |
| 74 | +# install nix and niv |
| 75 | +RUN curl -L -o install.sh https://nixos.org/nix/install \ |
| 76 | + && bash install.sh --daemon |
0 commit comments