Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image with Grenade built inside #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# NOTE: Tried with Haskell 8.2 and 8.0 and ended up with some build errors
#
FROM haskell:8.4

RUN mkdir /grenade
COPY . /grenade

#
# Install system dependencies
#
RUN apt-get update && apt-get install -y \
build-essential \
gfortran \
libatlas-base-dev \
libgsl0-dev \
liblapack-dev \
python \
wget

#
# Install Open Blas (with Lapack included)
# This is a depencency for building hmatrix package
#
ENV OPEN_BLAS_VER=0.2.20
RUN wget http://github.com/xianyi/OpenBLAS/archive/v$OPEN_BLAS_VER.tar.gz
RUN tar -xzvf v$OPEN_BLAS_VER.tar.gz

WORKDIR /OpenBLAS-$OPEN_BLAS_VER
RUN ls -la
RUN make FC=gfortran
RUN make PREFIX=/usr/local install

#
# Build and setup grenade
#
WORKDIR /grenade

RUN stack init
RUN stack setup --install-ghc
RUN stack build

# Optional GHCI prompt configuration
RUN echo ':set prompt "\ESC[34m位> \ESC[m"' > ~/.ghci

#
# Choose default main object to run GHCI
#
ENV GRENADE_MAIN=mnist

#
# Run GHC repl
#
CMD stack ghci --main-is grenade-examples:exe:$GRENADE_MAIN
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grenade:
build: .