Skip to content

Instantly share code, notes, and snippets.

@johnnyopao
Last active July 21, 2018 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnyopao/3a9656b76eac6036e72f36ac7a61ff7a to your computer and use it in GitHub Desktop.
Save johnnyopao/3a9656b76eac6036e72f36ac7a61ff7a to your computer and use it in GitHub Desktop.
FROM amazonlinux:latest
WORKDIR /app
# install pip
RUN curl -s https://bootstrap.pypa.io/get-pip.py | python
# requirements for compiling JAGs
RUN yum install -y \
gcc \
gcc-gfortran \
lapack-devel \
gcc-c++ \
findutils \
python27-devel
COPY JAGS-4.3.0.tar.gz .
RUN tar xf JAGS-4.3.0.tar.gz
# compile JAGs
WORKDIR JAGS-4.3.0/
RUN F77=gfortran ./configure --libdir=/usr/local/lib64
RUN make
RUN make install
# install python deps
WORKDIR /app
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:$PKG_CONFIG_PATH
COPY requirements.txt .
# numpy needs to be installed globally first as pyjags
# checks the regular path for numpy as a requirement
RUN pip install numpy
RUN pip install -t ./lib -r requirements.txt
# Copy libraries into project lib directory
RUN cp -a /usr/local/lib64/JAGS lib
RUN cp /usr/local/lib64/libjags.so.4 lib
RUN cp /usr/local/lib64/libjrmath.so.0 lib
RUN cp /usr/lib64/libgfortran.so.3 lib
RUN cp /usr/lib64/libblas.so.3 lib
RUN cp /usr/lib64/liblapack.so.3 lib
RUN cp /usr/lib64/libquadmath.so.0 lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment