forked from jmfee-usgs/geomag-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (46 loc) · 1.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM usgs/centos:latest AS pycurl-build
# install conda dependencies
RUN yum install -y \
bzip2 \
gcc \
libcurl-devel \
&& \
yum clean all
# 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 && \
rm ~/miniconda.sh
# 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.*' && \
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 <[email protected]>"
# 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' \
-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
EXPOSE 80
# entrypoint needs double quotes
ENTRYPOINT [ "/geomag-algorithms/docker-entrypoint.sh" ]