Skip to content

Commit

Permalink
Merge pull request #24 from MilesCranmer/master
Browse files Browse the repository at this point in the history
Created basic dockerfile
  • Loading branch information
rainwoodman committed May 20, 2017
2 parents 9924fbd + 21caf6a commit 634633a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Dockerfile
@@ -0,0 +1,32 @@
# Base image
FROM ubuntu:14.04

# No interaction during install
ARG DEBIAN_FRONTEND=noninteractive

# Install essentials
RUN apt-get -qqy update && \
apt-get -qqy install \
build-essential \
libopenmpi-dev \
openmpi-bin \
libgsl0-dev \
git \
curl

# Load fastpm into docker
WORKDIR /fastpm
COPY . .

# Build fastpm
RUN cd /fastpm && \
echo "CC = mpicc\nOPENMP = -fopenmp\nCPPFLAGS = -DFASTPM_FFT_PRECISION=32\nOPTIMIZE = -O3 -g" > Makefile.local && \
make

# Expose an address for jupyter notebooks
EXPOSE 8888

# Folder which can be used for connecting data directories
WORKDIR /workspace

ENTRYPOINT ["/bin/bash"]
21 changes: 21 additions & 0 deletions README.rst
Expand Up @@ -177,6 +177,27 @@ currently the compiler on these Macintosh Personal Computers do not support open
The compiler is also gives extra warnings, and remove `-Werror` from the Makefile.local
is recommended.

Docker
------

There is a basic docker configuration file to set up a container
for FastPM.

To build it, run:

.. code::
docker build -t fastpm .
To start the docker container in interactive mode,
with port 8888 exposed and with
``/my/file/directory`` linked, run

.. code::
docker run -it -v /my/file/directory:/workspace -p 8888:8888 fastpm
Examples
--------

Expand Down

0 comments on commit 634633a

Please sign in to comment.