Skip to content

Instantly share code, notes, and snippets.

@ikarino

ikarino/Dockerfile

Last active Aug 28, 2018
Embed
What would you like to do?
OpenMC dockerfile
FROM centos:latest
MAINTAINER ikarino <ba138ng@gmail.com>
# Run docker command with
# $ docker run -it --name=XXXX -p 8888:8888 image-name
# and open browser with given url and token
ENV FC=/usr/lib64/openmpi/bin/mpif90 CC=/usr/lib64/openmpi/bin/mpicc HDF5_ROOT=/usr/lib64/openmpi \
PATH=/opt/openmc/bin:/opt/conda/bin:$PATH \
OPENMC_CROSS_SECTIONS=/opt/openmc/data/nndc_hdf5/cross_sections.xml
RUN yum -y update && \
yum -y install epel-release && \
yum -y install wget bzip2 git cmake3 make gcc-gfortran gcc-c++ openmpi openmpi-devel hdf5 hdf5-devel hdf5-openmpi hdf5-openmpi-devel && \
yum clean all && \
rm -rf /var/cache/yum
# get miniconda3 and install dependencies
RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.4.10-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm -rf ~/miniconda.sh && \
pip install --upgrade pip && \
pip install six numpy scipy pandas h5py matplotlib uncertainties lxml cython vtk pytest jupyter
# install openmc
RUN git clone https://github.com/mit-crpg/openmc.git && \
cd openmc && python3 setup.py install && \
mkdir b && cd b && \
cmake3 -DCMAKE_INSTALL_PREFIX=/opt/openmc -Doptimize=on -DHDF5_PREFER_PARALLEL=on .. && \
make && make install
# download cross sections from NNDC
RUN mkdir /opt/openmc/data && cd /opt/openmc/data && \
openmc-get-nndc-data -b
CMD ["/opt/conda/bin/jupyter", "notebook", "--ip=0.0.0.0", "--allow-root"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment