-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
56 lines (43 loc) · 1.29 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 debian:buster
MAINTAINER Roman Leonhardt <[email protected]>
LABEL geomagpy.magpy.version=1.0.4
# update os
RUN apt-get update --fix-missing && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
make && \
apt-get clean
# install conda
ENV PATH="/conda/bin":$PATH
ARG PATH="/conda/bin":$PATH
RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b -p /conda \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
# install packages and dependencies via conda
RUN conda --version && \
conda install --yes jupyter scipy matplotlib && \
conda clean -i -t -y
RUN useradd \
-c 'Docker image user' \
-m \
-r \
-s /sbin/nologin \
magpyuser && \
mkdir -p /home/magpyuser/notebooks && \
mkdir -p /home/magpyuser/.conda && \
chown -R magpyuser:magpyuser /home/magpyuser
# copy library (ignores set in .dockerignore)
COPY . /magpy
# install magpy
RUN cd /tmp && \
pip install geomagpy && \
cd /tmp
USER magpyuser
WORKDIR /home/magpyuser
EXPOSE 80
# entrypoint needs double quotes
ENTRYPOINT [ "/magpy/docker-entrypoint.sh" ]