Newer
Older
FROM usgs/centos:latest AS pycurl-build
# install conda dependencies
RUN yum install -y \
libcurl-devel \
&& \
yum clean all

Jeremy M Fee
committed
# install conda
ENV PATH /conda/bin:$PATH
RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
curl https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh \
-o ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /conda && \

Jeremy M Fee
committed
rm ~/miniconda.sh

Jeremy M Fee
committed
# install algorithms and dependencies via conda
RUN conda config --set ssl_verify $SSL_CERT_FILE && \
conda config --add channels conda-forge && \
conda install --yes jupyter obspy 'icu=58.*' && \

Jeremy M Fee
committed
conda clean -i -l -t -y && \
# build pycurl with SFTP support
export PIP_CERT=$SSL_CERT_FILE && \
export PYCURL_SSL_LIBRARY=nss && \
pip install pycurl
FROM usgs/centos:latest
LABEL maintainer="Jeremy Fee <jmfee@usgs.gov>"
# use conda install from build container
ENV PATH /conda/bin:$PATH
COPY --from=pycurl-build /conda /conda
COPY --from=pycurl-build /etc/profile.d/conda.sh /etc/profile.d/conda.sh
# copy library (ignores set in .dockerignore)
COPY . /geomag-algorithms
RUN pip install /geomag-algorithms && \
useradd \
-c 'Docker image user' \

Jeremy M Fee
committed
-m \
-r \
-s /sbin/nologin \
geomag_user && \
mkdir -p /home/geomag_user/notebooks && \
chown -R geomag_user:geomag_user /home/geomag_user
USER geomag_user
WORKDIR /home/geomag_user
# entrypoint needs double quotes
ENTRYPOINT [ "/geomag-algorithms/docker-entrypoint.sh" ]