Skip to content
Snippets Groups Projects
Dockerfile 1.71 KiB
Newer Older
Jeremy M Fee's avatar
Jeremy M Fee committed
FROM debian:jessie

MAINTAINER Jeremy Fee <jmfee@usgs.gov>
Jeremy M Fee's avatar
Jeremy M Fee committed
LABEL usgs.geomag-algorithms.version=0.4.0
Jeremy M Fee's avatar
Jeremy M Fee committed

# update os
RUN apt-get update --fix-missing && \
    apt-get install -y --no-install-recommends \
        bzip2 \
        ca-certificates \
        curl \
        gcc \
        libcurl4-gnutls-dev \
        libglib2.0-0 \
        libgnutls28-dev \
        libsm6 \
        libxext6 \
        libxrender1 && \
    apt-get clean


Jeremy M Fee's avatar
Jeremy M Fee committed
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's avatar
Jeremy M Fee committed


# copy library (ignores set in .dockerignore)
COPY . /geomag-algorithms


# configure DOI SSL intercept certificate
# (required when building image from within DOI network)
RUN mkdir -p /usr/local/share/ca-certificates && \
    cp /geomag-algorithms/etc/DOIRootCA2.crt /usr/local/share/ca-certificates/. && \
    update-ca-certificates && \
    conda config --set ssl_verify /etc/ssl/certs/ca-certificates.crt


# install algorithms and dependencies via conda
RUN conda config --add channels obspy && \
    conda install --yes jupyter obspy && \
    conda clean -i -l -t -y && \
    pip install pycurl && \
    pip install /geomag-algorithms && \
    useradd \
        -c 'Docker image user' \
        -r \
        -s /sbin/nologin \
         geomag_user && \
    mkdir -p /home/geomag_user/notebooks && \
    chown -R geomag_user:geomag_user /home/geomag_user

Jeremy M Fee's avatar
Jeremy M Fee committed

Jeremy M Fee's avatar
Jeremy M Fee committed

Jeremy M Fee's avatar
Jeremy M Fee committed
EXPOSE 80
# entrypoint needs double quotes
ENTRYPOINT [ "/geomag-algorithms/docker-entrypoint.sh" ]