Skip to content

Instantly share code, notes, and snippets.

@neongreen
Last active April 22, 2018 02:01
Show Gist options
  • Select an option

  • Save neongreen/56726b161a7d1ea2a23fc044b61d0aa3 to your computer and use it in GitHub Desktop.

Select an option

Save neongreen/56726b161a7d1ea2a23fc044b61d0aa3 to your computer and use it in GitHub Desktop.
# Use Fedora as the base
FROM fedora:27
# Install git
RUN dnf -y install git
# Install Stack
ARG STACK_VERSION=1.6.3
RUN curl -sSfL https://github.com/commercialhaskell/stack/releases/download/v${STACK_VERSION}/stack-${STACK_VERSION}-linux-x86_64-static.tar.gz \
| tar --wildcards -C /usr/local/bin --strip-components=1 -xzvf - '*/stack' && chmod 755 /usr/local/bin/stack
# Get a version of cardano-sl that is recent enough; we'll build its
# dependencies so that they would be cached by Docker
RUN git clone https://github.com/input-output-hk/cardano-sl \
&& cd cardano-sl \
&& git reset --hard aed0d925b06e0bd1278e26539c445274c52f4b67 # a recent-ish master
# Install GHC
RUN dnf -y install xz make gcc gmp-devel \
&& cd cardano-sl && stack setup
# Build everything, and afterwards get rid of build artifacts but retain
# built dependencies
RUN dnf -y install zlib-devel gcc-c++ openssl-devel xz-devel \
rocksdb rocksdb-devel ncurses-devel \
&& cd cardano-sl && stack install cpphs \
&& stack build \
&& stack clean
# Build the latest master (as of April 21, 2018)
RUN cd cardano-sl && git fetch \
&& git reset --hard 1.1.1 \
&& stack build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment